public IFuture<Void> execute(IInternalAccess ia) { // System.out.println(agent.getComponentIdentifier()+": getResult3"); ret.setResultIfUndone("result"); return null; } });
public void exceptionOccurred(Exception exception) { ret.setExceptionIfUndone(exception); } });
/** * Terminate the future. * The exception will be set to FutureTerminatedException. */ public void terminate() { terminate(new FutureTerminatedException()); }
public void resultAvailable(Object result) { if(exfire.isSucceeded()) ret.setResult(null); else ret.setException(new RuntimeException("Goal failure.")); }
final TerminableFuture<String> ret = new TerminableFuture<String>(new TerminationCommand()
lastsearch.terminate(); final TerminableFuture<Void> ret = new TerminableFuture<Void>(new ITerminationCommand() lastsearch.setResultIfUndone(null); return;
final TerminableFuture<Void> ret = new TerminableFuture<Void>(new TerminationCommand() if(exgoals.length>0) ret.setException(new IllegalStateException("Can only handle one order at a time. Use abort() first.")); if(goals.length>0) ret.setException(new IllegalStateException("Can only handle one order at a time. Use abort() first."));
public void resultAvailable(Object result) { if(tv.isSucceeded()) { ret.setResultIfUndone(null); } else { ret.setExceptionIfUndone( tv.getException()!=null ? tv.getException() : new RuntimeException("aborted")); } }
public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
ti.setState(TransferInfo.STATE_WAITING); TerminableFuture<IOutputConnection> ret = new TerminableFuture<IOutputConnection>(new TerminationCommand()
final TerminableFuture<Void> ret = new TerminableFuture<Void>(new TerminationCommand() if(exgoals.length>0) ret.setException(new IllegalStateException("Can only handle one order at a time. Use abort() first.")); if(goals.length>0) ret.setException(new IllegalStateException("Can only handle one order at a time. Use abort() first."));
public void resultAvailable(Object result) { if(clearchem.isSucceeded()) ret.setResult(null); else ret.setException(new RuntimeException("Goal failure.")); }
public void exceptionOccurred(Exception exception) { ret.setException(exception); } });
ti.setState(TransferInfo.STATE_WAITING); TerminableFuture<IOutputConnection> ret = new TerminableFuture<IOutputConnection>(new TerminationCommand()
/** * Terminate the future and supply a custom reason. */ public void terminate(Exception reason) { boolean term = terminate==null || terminate.checkTermination(reason); if(term && setExceptionIfUndone(reason)) { if(terminate!=null) terminate.terminated(reason); } }
ti.setState(TransferInfo.STATE_WAITING); TerminableFuture<IOutputConnection> ret = new TerminableFuture<IOutputConnection>(new TerminationCommand()
final TerminableFuture<Void> ret = new TerminableFuture<Void>(new TerminationCommand()