public class DelegationResultListener<E> extends java.lang.Object implements IResultListener<E>, IFutureCommandListener, IUndoneResultListener<E>
Modifier and Type | Field and Description |
---|---|
protected IFunctionalResultListener<E> |
customResultListener
Custom functional result listener
|
protected Future<E> |
future
The future to which calls are delegated.
|
protected boolean |
undone
Flag if undone methods should be used.
|
Constructor and Description |
---|
DelegationResultListener(Future<E> future)
Create a new listener.
|
DelegationResultListener(Future<E> future,
boolean undone)
Create a new listener.
|
DelegationResultListener(Future<E> future,
boolean undone,
IFunctionalResultListener<E> customResultListener)
Create a new listener.
|
DelegationResultListener(Future<E> future,
IFunctionalResultListener<E> customResultListener)
Create a new listener.
|
Modifier and Type | Method and Description |
---|---|
void |
commandAvailable(java.lang.Object command)
Called when a command is available.
|
void |
customResultAvailable(E result)
Called when the result is available.
|
void |
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.
|
void |
exceptionOccurredIfUndone(java.lang.Exception exception)
Called when an exception occurred.
|
boolean |
isUndone()
Get the undone.
|
void |
resultAvailable(E result)
Called when the result is available.
|
void |
resultAvailableIfUndone(E result)
Called when the result is available.
|
protected boolean undone
protected IFunctionalResultListener<E> customResultListener
public DelegationResultListener(Future<E> future, IFunctionalResultListener<E> customResultListener)
future
- The delegation target.customResultListener
- Custom result listener that overwrites the delegation behaviour.public DelegationResultListener(Future<E> future, boolean undone, IFunctionalResultListener<E> customResultListener)
future
- The delegation target.undone
- use undone methods.customResultListener
- Custom result listener that overwrites the delegation behaviour.public final void resultAvailable(E result)
resultAvailable
in interface IFunctionalResultListener<E>
result
- The result.public void customResultAvailable(E result)
result
- The result.public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface IFunctionalExceptionListener
exception
- The exception.public void commandAvailable(java.lang.Object command)
commandAvailable
in interface IFutureCommandListener
public void resultAvailableIfUndone(E result)
resultAvailableIfUndone
in interface IUndoneResultListener<E>
result
- The result.public void exceptionOccurredIfUndone(java.lang.Exception exception)
exceptionOccurredIfUndone
in interface IUndoneResultListener<E>
exception
- The exception.public boolean isUndone()