/** * Called when the plan is aborted. */ public void aborted() { if(ef!=null) { ef.terminate(); } } }
/** * Called when the plan is aborted. */ public void aborted() { if(cc!=null) { cc.terminate(); } } }
public void intermediateResultAvailable(Void result) { fut.terminate(); } public void customResultAvailable(Collection<Void> result)
/** * Terminate the future and supply a custom reason. */ public void terminate(Exception reason) { boolean mynotify; synchronized(this) { // Notify when src is set and not already notified // Remember to notify when src is not set and not already notified mynotify = src!=null && !notified; notify = src==null && !notified; notified = notified || mynotify; if(notify) this.reason = reason; } if(mynotify) src.terminate(reason); }
/** * Called when the plan is aborted. */ @PlanAborted public void aborted() { if(cc!=null) { cc.terminate(); } }
/** * Called when the plan is aborted. */ @PlanAborted public void aborted() { if(ef!=null) { ef.terminate(); } }
public void exceptionOccurred(Exception exception) { // Forward timeout exception to future. if(exception instanceof TimeoutException) { fut.setExceptionIfUndone(exception); if(fut instanceof ITerminableFuture<?>) { ((ITerminableFuture)fut).terminate(exception); } } }
public void exceptionOccurred(Exception exception) { // Forward timeout exception to future. if(exception instanceof TimeoutException) { fut.setExceptionIfUndone(exception); if(res instanceof ITerminableFuture<?>) { ((ITerminableFuture)fut).terminate(exception); } } } public void intermediateResultAvailable(Object result)
public void exceptionOccurred(Exception exception) { // Forward timeout exception to future. if(exception instanceof TimeoutException) { fut.setExceptionIfUndone(exception); if(fut instanceof ITerminableFuture<?>) { ((ITerminableFuture)fut).terminate(exception); } } }
public void run() { Object tfut = rsms.getProcessingCall(terminatecallid); if(tfut!=null) { // System.out.println("terminated future afterwards"); ((ITerminableFuture<?>)tfut).terminate(exception); } } });
public void run() { Object tfut = rsms.getProcessingCall(terminatecallid); if(tfut!=null) { // System.out.println("terminated future afterwards"); ((ITerminableFuture<?>)tfut).terminate(exception); } } });
public void exceptionOccurred(Exception exception) { // Forward timeout exception to future. if(exception instanceof TimeoutException) { fut.setExceptionIfUndone(exception); if(res instanceof ITerminableFuture<?>) { ((ITerminableFuture)fut).terminate(exception); } } } public void intermediateResultAvailable(Object result)
/** * Called when the plan is aborted. */ public void aborted() { if(tv!=null) { try { tv.terminate(); } catch(Exception e) { // Wait until service is finished before superordinated goal is dropped. tv.get(); } } } }
/** * Set the termination source. */ public void setTerminationSource(ITerminableFuture<?> src) { assert this.src==null; boolean mynotify; synchronized(this) { // Notify when someone has called terminate (notify is set) // src is set and not already notified this.src = src; mynotify = notify && !notified; notified = notified || mynotify; } if(mynotify) src.terminate(reason); if(storedinfos!=null) { for(Object info: storedinfos) { src.sendBackwardCommand(info); } storedinfos = null; } }
public void run() { Object tfut = rsms.getProcessingCall(terminatecallid); if(tfut!=null) { // System.out.println("terminated future afterwards"); ((ITerminableFuture<?>)tfut).terminate(exceptioninfo.recreateException()); } } });
/** * Called when the plan is aborted. */ @PlanAborted public void aborted() { if(tv!=null) { try { tv.terminate(); } catch(Exception e) { // Wait until service is finished before superordinated goal is dropped. tv.get(); } } }
public IFuture<Void> execute(IInternalAccess ia) { if(!future.isDone()) { WaitingCallInfo wci = rms.removeWaitingCall(callid); if(future instanceof ITerminableFuture) { ((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci)); } else { future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci)); } } return IFuture.DONE; } });
public IFuture<Void> execute(IInternalAccess ia) { if(!future.isDone()) { WaitingCallInfo wci = rms.removeWaitingCall(callid); if(future instanceof ITerminableFuture) { ((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci+", "+timeout)); } else { future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci+", "+timeout)); } } return IFuture.DONE; } });
public IFuture<Void> execute(IInternalAccess ia) { if(!future.isDone()) { WaitingCallInfo wci = rms.removeWaitingCall(callid); if(future instanceof ITerminableFuture) { ((ITerminableFuture<?>)future).terminate(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci)); } else { future.setExceptionIfUndone(new TimeoutException("No reply received and timeout occurred: " +receiver+", "+callid+", "+wci)); } } return IFuture.DONE; } });
((ITerminableFuture<?>)tfut).terminate(exceptioninfo.recreateException());