public class TerminableDelegationFuture<E> extends Future<E> implements ITerminableFuture<E>
IForwardCommandFuture.Type
Modifier and Type | Field and Description |
---|---|
protected boolean |
notified
Flag if source has been notified.
|
protected boolean |
notify
Flag if source has to be notified.
|
protected java.lang.Exception |
reason
Exception used for notification.
|
protected ITerminableFuture<?> |
src
The termination source.
|
protected java.util.List<java.lang.Object> |
storedinfos
The list of stored infos, to be sent when src is connected.
|
CALLER_QUEUED, CALLER_RESUMED, CALLER_SUSPENDED, callers, creation, DEBUG, exception, first, listener, listeners, NO_STACK_COMPACTION, NONE, notcommand, notifications, result, resultavailable, STACK, undone, UNSET
Constructor and Description |
---|
TerminableDelegationFuture()
Create a new future.
|
TerminableDelegationFuture(ITerminableFuture<?> src)
Create a new future.
|
Modifier and Type | Method and Description |
---|---|
void |
sendBackwardCommand(java.lang.Object info)
Send a backward command in direction of the source.
|
void |
setTerminationSource(ITerminableFuture<?> src)
Set the termination source.
|
void |
terminate()
Terminate the future.
|
void |
terminate(java.lang.Exception reason)
Terminate the future and supply a custom reason.
|
abortGet, acceptEither, addResultListener, addResultListener, addResultListener, applyToEither, delegate, doSetException, doSetResult, exceptionally, exceptionally, exceptionally, executeNotification, get, get, get, get, get, getEmptyFuture, getException, getFuture, getNotificationCommand, hasResultListener, isDone, notifyListener, notifyListener, resume, scheduleNotification, scheduleNotification, scheduleNotification, sendForwardCommand, setException, setExceptionIfUndone, setResult, setResultIfUndone, startScheduledNotifications, thenAccept, thenAccept, thenApply, thenApply, thenCombine, thenCompose, thenCompose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acceptEither, addResultListener, addResultListener, addResultListener, applyToEither, delegate, exceptionally, exceptionally, exceptionally, get, get, get, get, get, getException, isDone, thenAccept, thenAccept, thenApply, thenApply, thenCombine, thenCompose, thenCompose
protected ITerminableFuture<?> src
protected boolean notify
protected boolean notified
protected java.lang.Exception reason
protected java.util.List<java.lang.Object> storedinfos
public TerminableDelegationFuture()
public TerminableDelegationFuture(ITerminableFuture<?> src)
public void setTerminationSource(ITerminableFuture<?> src)
public void terminate()
terminate
in interface ITerminableFuture<E>
public void terminate(java.lang.Exception reason)
terminate
in interface ITerminableFuture<E>
public void sendBackwardCommand(java.lang.Object info)
sendBackwardCommand
in interface IBackwardCommandFuture
info
- The command info.