Package jadex.commons.future
Class TerminableIntermediateDelegationFuture<E>
- java.lang.Object
- 
- jadex.commons.future.Future<java.util.Collection<E>>
- 
- jadex.commons.future.IntermediateFuture<E>
- 
- jadex.commons.future.TerminableIntermediateDelegationFuture<E>
 
 
 
- 
- All Implemented Interfaces:
- IBackwardCommandFuture,- IForwardCommandFuture,- IFuture<java.util.Collection<E>>,- IIntermediateFuture<E>,- ITerminableFuture<java.util.Collection<E>>,- ITerminableIntermediateFuture<E>
 - Direct Known Subclasses:
- PullIntermediateDelegationFuture,- SubscriptionIntermediateDelegationFuture
 
 public class TerminableIntermediateDelegationFuture<E> extends IntermediateFuture<E> implements ITerminableIntermediateFuture<E> A terminable intermediate delegation future can be used when a termination intermediate future should be delegated. This kind of future needs to be connected to the termination source (another delegation or a real future). Termination calls are forwarded to the termination source. The future remembers when terminate() was called in unconnected state and forwards the request as soon as the connection is established.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jadex.commons.future.IForwardCommandFutureIForwardCommandFuture.Type
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected booleannotifiedFlag if source has been notified.protected booleannotifyFlag if source has to be notified.protected java.lang.ExceptionreasonException used for notification.protected ITerminableIntermediateFuture<?>srcThe termination source.protected java.util.List<java.lang.Object>storedinfosThe list of stored infos, to be sent when src is connected.- 
Fields inherited from class jadex.commons.future.IntermediateFutureicallers, indices, intermediate, maxresultcnt, notcommand, results
 - 
Fields inherited from class jadex.commons.future.FutureCALLER_QUEUED, CALLER_RESUMED, CALLER_SUSPENDED, callers, creation, DEBUG, exception, first, listener, listeners, NO_STACK_COMPACTION, NONE, notifications, result, resultavailable, STACK, undone, UNSET
 - 
Fields inherited from interface jadex.commons.future.IIntermediateFutureDONE
 
- 
 - 
Constructor SummaryConstructors Constructor Description TerminableIntermediateDelegationFuture()Create a new future.TerminableIntermediateDelegationFuture(ITerminableIntermediateFuture<?> src)Create a new future.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoNotify()Possibly notify the termination source.ITerminableIntermediateFuture<?>getSource()Get the src.voidsendBackwardCommand(java.lang.Object info)Send a backward command in direction of the source.voidsetSource(ITerminableIntermediateFuture<?> src)Set the source.voidterminate()Terminate the future.voidterminate(java.lang.Exception reason)Terminate the future and supply a custom reason.- 
Methods inherited from class jadex.commons.future.IntermediateFutureaddIntermediateResult, addIntermediateResultIfUndone, addIntermediateResultListener, addResultListener, catchErr, doAddIntermediateResult, doGetNextIntermediateResult, doSetFinished, doSetResult, finished, flatMapAsync, getIntermediateResults, getNextIntermediateResult, getNextIntermediateResult, getNextIntermediateResult, getNotificationCommand, getResultCount, hasNextIntermediateResult, hasNextIntermediateResult, mapAsync, mapAsync, max, next, notifyIntermediateResult, resume, resumeIntermediate, scheduleMaxNotification, setFinished, setFinishedIfUndone, setMaxResultCount, storeResult
 - 
Methods inherited from class jadex.commons.future.FutureabortGet, catchErr, catchErr, delegate, doSetException, executeNotification, get, get, get, get, get, getEmptyFuture, getException, getFuture, hasResultListener, isDone, notifyListener, notifyListener, scheduleNotification, scheduleNotification, scheduleNotification, sendForwardCommand, setException, setExceptionIfUndone, setResult, setResultIfUndone, startScheduledNotifications, then, thenAccept, thenAccept, thenApply, thenApply, thenCombine, thenCompose, thenCompose
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface jadex.commons.future.IFutureaddResultListener, catchErr, catchErr, catchErr, delegate, get, get, get, get, get, getException, isDone, then, thenApply, thenApply, thenCompose, thenCompose
 - 
Methods inherited from interface jadex.commons.future.IIntermediateFuturefinished, flatMapAsync, getIntermediateResults, getNextIntermediateResult, getNextIntermediateResult, hasNextIntermediateResult, hasNextIntermediateResult, mapAsync, mapAsync, max, next
 
- 
 
- 
- 
- 
Field Detail- 
srcprotected ITerminableIntermediateFuture<?> src The termination source.
 - 
notifyprotected boolean notify Flag if source has to be notified.
 - 
notifiedprotected boolean notified Flag if source has been notified.
 - 
reasonprotected java.lang.Exception reason Exception used for notification.
 - 
storedinfosprotected java.util.List<java.lang.Object> storedinfos The list of stored infos, to be sent when src is connected.
 
- 
 - 
Constructor Detail- 
TerminableIntermediateDelegationFuturepublic TerminableIntermediateDelegationFuture() Create a new future.
 - 
TerminableIntermediateDelegationFuturepublic TerminableIntermediateDelegationFuture(ITerminableIntermediateFuture<?> src) Create a new future.
 
- 
 - 
Method Detail- 
setSourcepublic void setSource(ITerminableIntermediateFuture<?> src) Set the source.
 - 
getSourcepublic ITerminableIntermediateFuture<?> getSource() Get the src.- Returns:
- The src.
 
 - 
doNotifyprotected void doNotify() Possibly notify the termination source.
 - 
terminatepublic void terminate() Terminate the future. The exception will be set to FutureTerminatedException.- Specified by:
- terminatein interface- ITerminableFuture<E>
 
 - 
terminatepublic void terminate(java.lang.Exception reason) Terminate the future and supply a custom reason.- Specified by:
- terminatein interface- ITerminableFuture<E>
 
 - 
sendBackwardCommandpublic void sendBackwardCommand(java.lang.Object info) Send a backward command in direction of the source.- Specified by:
- sendBackwardCommandin interface- IBackwardCommandFuture
- Parameters:
- info- The command info.
 
 
- 
 
-