public void intermediateResultAvailable(Void result) { fut.terminate(); } public void customResultAvailable(Collection<Void> result)
public IFuture<Void> execute(IInternalAccess ia) { fut.terminate(); return IFuture.DONE; } });
/** * Possibly notify the termination source. */ protected void doNotify() { boolean mynotify; synchronized(this) { // Notify when someone has called terminate (notify is set) // src is set and not already notified mynotify = notify && !notified; notified = notified || mynotify; } if(mynotify) src.terminate(reason); }
public void terminated(Exception reason) { Set<ITerminableIntermediateFuture<IService>> ocs = opencalls.get(ret); if(ocs!=null) { for(ITerminableIntermediateFuture<IService> fut: ocs) { fut.terminate(reason); } } opencalls.remove(ret); }
public void terminated(Exception reason) { Set<ITerminableIntermediateFuture<IService>> ocs = opencalls.get(ret); if(ocs!=null) { for(ITerminableIntermediateFuture<IService> fut: ocs) { fut.terminate(reason); } } opencalls.remove(ret); }
/** * 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); if(storedinfos!=null) { for(Object info: storedinfos) { src.sendBackwardCommand(info); } storedinfos = null; } }
public void intermediateResultAvailable(Long filesize) { if(TransferInfo.STATE_ABORTED.equals(ti.getState())) { fut.terminate(); } if(ret!=null) { ret.addIntermediateResult(new Long(filesize)); } if(ti.update(filesize)) { publishEvent(ChatEvent.TYPE_FILE, null, ti.getOther(), ti); } } public void finished()
public void intermediateResultAvailable(Long filesize) { if(TransferInfo.STATE_ABORTED.equals(ti.getState())) { ocon.close(); fut.terminate(); } if(ti.update(filesize)) { publishEvent(ChatEvent.TYPE_FILE, null, ti.getOther(), ti); } } public void finished()
public void intermediateResultAvailable(Long filesize) { if(TransferInfo.STATE_ABORTED.equals(ti.getState())) { fut.terminate(); } if(ret!=null) { ret.addIntermediateResult(filesize); } if(ti.update(filesize)) { publishEvent(ChatEvent.TYPE_FILE, null, ti.getOther(), ti); } } public void finished()
public void intermediateResultAvailable(Long filesize) { if(TransferInfo.STATE_ABORTED.equals(ti.getState())) { fut.terminate(); } if(ret!=null) { ret.addIntermediateResult(filesize); } if(ti.update(filesize)) { publishEvent(ChatEvent.TYPE_FILE, null, ti.getOther(), ti); } } public void finished()
/** * Rank the results and announce them */ protected void rankResults() { if(!isFinished()) { // Terminate the source ((TerminableIntermediateDelegationFuture<S>)future).getSource().terminate(); ranker.rankWithScores(results).addResultListener(new IResultListener<List<Tuple2<S, Double>>>() { public void resultAvailable(List<Tuple2<S, Double>> result) { notifyResults(result); } public void exceptionOccurred(Exception exception) { notifyException(exception); } }); } }
/** * Rank the results and announce them */ protected void rankResults() { if(!isFinished()) { // Terminate the source ((TerminableIntermediateDelegationFuture<S>)future).getSource().terminate(); ranker.rankWithScores(results).addResultListener(new IResultListener<List<Tuple2<S, Double>>>() { public void resultAvailable(List<Tuple2<S, Double>> result) { notifyResults(result); } public void exceptionOccurred(Exception exception) { notifyException(exception); } }); } }