public void resultAvailable(Void result) { ret.setFinishedIfUndone(); } public void exceptionOccurred(Exception exception)
public void resultAvailable(Void result) { ret.setFinishedIfUndone(); } public void exceptionOccurred(Exception exception)
public void finished() { // System.out.println("finiiii"); ret.setFinishedIfUndone(); } });
/** * Set the stream to be closed. */ public void setClosed() { super.setClosed(); Future<Byte> oret; boolean cl; synchronized(this) { super.setClosed(); oret = ofuture; cl = position==size; } // System.out.println("setClosed(InputCon): "+position+" "+size+" "+cl); // notify async listener if last byte has been read and stream is closed. if(ifuture!=null && cl) { ifuture.setFinishedIfUndone(); } else if(oret!=null && cl) { oret.setException(new RuntimeException("Stream closed")); } }
/** * Set the stream to be closed. */ public void setClosed() { super.setClosed(); Future<Byte> oret; boolean cl; synchronized(this) { super.setClosed(); oret = ofuture; cl = position==size; } // System.out.println("setClosed(InputCon): "+position+" "+size+" "+cl); // notify async listener if last byte has been read and stream is closed. if(ifuture!=null && cl) { ifuture.setFinishedIfUndone(); } else if(oret!=null && cl) { oret.setException(new RuntimeException("Stream closed")); } }
/** * Set the stream to be closed. */ public void setClosed() { super.setClosed(); Future<Byte> oret; boolean cl; synchronized(this) { super.setClosed(); oret = ofuture; cl = position==size; } // System.out.println("setClosed(InputCon): "+position+" "+size+" "+cl); // notify async listener if last byte has been read and stream is closed. if(ifuture!=null && cl) { ifuture.setFinishedIfUndone(); } else if(oret!=null && cl) { oret.setException(new RuntimeException("Stream closed")); } }
/** * Notify subscribers that monitoring service is terminated. */ @ServiceShutdown public IFuture<Void> shutdown() { Future<Void> ret = new Future<Void>(); if(subscriptions!=null) { for(SubscriptionIntermediateFuture<IMonitoringEvent> sub: subscriptions.keySet()) { sub.setFinishedIfUndone(); } ret.setResult(null); } else { ret.setResult(null); } return ret; }
/** * Notify subscribers that monitoring service is terminated. */ @ServiceShutdown public IFuture<Void> shutdown() { Future<Void> ret = new Future<Void>(); if(subscriptions!=null) { for(SubscriptionIntermediateFuture<IMonitoringEvent> sub: subscriptions.keySet()) { sub.setFinishedIfUndone(); } ret.setResult(null); } else { ret.setResult(null); } return ret; }
/** * Perform cleanup in shutdown or kill. */ protected void doCleanup() { if(resfuts!=null) { Exception ex = getComponent().getException(); if(ex!=null) { for(SubscriptionIntermediateFuture<Tuple2<String, Object>> fut: resfuts) { fut.setExceptionIfUndone(ex); } } else { for(SubscriptionIntermediateFuture<Tuple2<String, Object>> fut: resfuts) { fut.setFinishedIfUndone(); } } resfuts = null; } }
ret.setFinishedIfUndone(); ret.setFinishedIfUndone();