/** * */ public DelegatingPullIntermediateDelegationFuture(IPullIntermediateFuture<?> src, FutureFunctionality func) { if(func==null) throw new IllegalArgumentException("Func must not null."); this.func = func; src.addResultListener(new TerminableIntermediateDelegationResultListener(this, src)); }
/** * Pull an intermediate result. */ public void pullIntermediateResult() { int mynotifycnt = 0; synchronized(this) { // Notify when someone has called terminate (notify is set) // src is set and not already notified notifycnt++; if(src!=null) { mynotifycnt = notifycnt; notifycnt = 0; } } for(int i=0; i<mynotifycnt; i++) ((IPullIntermediateFuture<E>)src).pullIntermediateResult(); } }
/** * Possibly notify the termination source. */ protected void doNotify() { super.doNotify(); int mynotifycnt = 0; synchronized(this) { mynotifycnt = notifycnt; notifycnt = 0; } for(int i=0; i<mynotifycnt; i++) ((IPullIntermediateFuture<E>)src).pullIntermediateResult(); }
/** * */ public DelegatingPullIntermediateDelegationFuture(IPullIntermediateFuture<?> src, FutureFunctionality func) { if(func==null) throw new IllegalArgumentException("Func must not null."); this.func = func; src.addResultListener(new TerminableIntermediateDelegationResultListener(this, src)); }
public void run() { Object tfut = rsms.getProcessingCall(pullcallid); if(tfut!=null) { // System.out.println("terminated future afterwards"); if(tfut instanceof IPullIntermediateFuture) { ((IPullIntermediateFuture<?>)tfut).pullIntermediateResult(); } else { ((IPullSubscriptionIntermediateFuture<?>)tfut).pullIntermediateResult(); } } } });
/** * Create a new future. */ public PullIntermediateDelegationFuture(IPullIntermediateFuture<?> src) { src.addResultListener(new TerminableIntermediateDelegationResultListener(this, src)); }
public void run() { Object tfut = rsms.getProcessingCall(pullcallid); if(tfut!=null) { // System.out.println("terminated future afterwards"); if(tfut instanceof IPullIntermediateFuture) { ((IPullIntermediateFuture<?>)tfut).pullIntermediateResult(); } else { ((IPullSubscriptionIntermediateFuture<?>)tfut).pullIntermediateResult(); } } } });
((IPullIntermediateFuture<?>)tfut).pullIntermediateResult();
((IPullIntermediateFuture<?>)tfut).pullIntermediateResult();