< prev index next >

tools/Jemmy/JemmyFX/src/org/jemmy/fx/QueueExecutor.java

Print this page




 205                 action.execute(parameters);
 206             } catch (RuntimeException e) {
 207             }
 208             synchronized (this) {
 209                 done = true;
 210                 notifyAll();
 211             }
 212         }
 213 
 214         public boolean isDone() {
 215             return done;
 216         }
 217 
 218         public void clean() {
 219             done = false;
 220             action = null;
 221             parameters = null;
 222         }
 223 
 224         public boolean failed() {
 225             return action.failed();
 226         }
 227 
 228         public Throwable getThrowable() {
 229             return action.getThrowable();
 230         }
 231 
 232         public synchronized void waitDone(Timeout timeout) {
 233             try {
 234                 while (!done) {
 235                     wait(timeout.getValue());

 236                 }
 237             } catch (InterruptedException ex) {
 238             }
 239         }
 240     }
 241 }


 205                 action.execute(parameters);
 206             } catch (RuntimeException e) {
 207             }
 208             synchronized (this) {
 209                 done = true;
 210                 notifyAll();
 211             }
 212         }
 213 
 214         public boolean isDone() {
 215             return done;
 216         }
 217 
 218         public void clean() {
 219             done = false;
 220             action = null;
 221             parameters = null;
 222         }
 223 
 224         public boolean failed() {
 225             return !done || action.failed();
 226         }
 227 
 228         public Throwable getThrowable() {
 229             return action.getThrowable();
 230         }
 231 
 232         public synchronized void waitDone(Timeout timeout) {
 233             try {
 234                 long maxTime = System.currentTimeMillis() + timeout.getValue();
 235                 while (!done && System.currentTimeMillis() < maxTime) {
 236                     wait(maxTime - System.currentTimeMillis());
 237                 }
 238             } catch (InterruptedException ex) {
 239             }
 240         }
 241     }
 242 }
< prev index next >