public class IntermediateDelegationResultListener<E> extends java.lang.Object implements IIntermediateResultListener<E>, IFutureCommandListener, IUndoneIntermediateResultListener<E>
Modifier and Type | Field and Description |
---|---|
protected IFunctionalResultListener<E> |
customIntermediateResultListener
Custom functional result listener
|
protected IntermediateFuture<E> |
future
The future to which calls are delegated.
|
protected boolean |
undone
Flag if undone methods should be used.
|
Constructor and Description |
---|
IntermediateDelegationResultListener(IntermediateFuture<E> future)
Create a new listener.
|
IntermediateDelegationResultListener(IntermediateFuture<E> future,
boolean undone)
Create a new listener.
|
IntermediateDelegationResultListener(IntermediateFuture<E> future,
boolean undone,
IFunctionalResultListener<E> customIntermediateResultListener)
Create a new listener.
|
IntermediateDelegationResultListener(IntermediateFuture<E> future,
IFunctionalResultListener<E> customIntermediateResultListener)
Create a new listener.
|
Modifier and Type | Method and Description |
---|---|
void |
commandAvailable(java.lang.Object command)
Called when a command is available.
|
void |
customIntermediateResultAvailable(E result)
Called when an intermediate result is available.
|
void |
customResultAvailable(java.util.Collection<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.
|
void |
finished()
Declare that the future is finished.
|
void |
finishedIfUndone()
Declare that the future is finished.
|
void |
intermediateResultAvailable(E result)
Called when an intermediate result is available.
|
void |
intermediateResultAvailableIfUndone(E result)
Called when an intermediate result is available.
|
void |
resultAvailable(java.util.Collection<E> result)
Called when the result is available.
|
void |
resultAvailableIfUndone(java.util.Collection<E> result)
Called when the result is available.
|
protected IntermediateFuture<E> future
protected boolean undone
protected IFunctionalResultListener<E> customIntermediateResultListener
public IntermediateDelegationResultListener(IntermediateFuture<E> future, IFunctionalResultListener<E> customIntermediateResultListener)
future
- The delegation target.undone
- use undone methods.customResultListener
- Custom result listener that overwrites the
delegation behaviour.public IntermediateDelegationResultListener(IntermediateFuture<E> future, boolean undone, IFunctionalResultListener<E> customIntermediateResultListener)
future
- The delegation target.undone
- use undone methods.customResultListener
- Custom result listener that overwrites the
delegation behaviour. Can be nullpublic IntermediateDelegationResultListener(IntermediateFuture<E> future)
public IntermediateDelegationResultListener(IntermediateFuture<E> future, boolean undone)
public final void resultAvailable(java.util.Collection<E> result)
resultAvailable
in interface IFunctionalResultListener<java.util.Collection<E>>
resultAvailable
in interface IIntermediateResultListener<E>
result
- The result.public final void intermediateResultAvailable(E result)
intermediateResultAvailable
in interface IIntermediateResultListener<E>
result
- The result.public void finished()
finished
in interface IIntermediateResultListener<E>
public void customResultAvailable(java.util.Collection<E> result)
result
- The result.public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface IFunctionalExceptionListener
exception
- The exception.public void customIntermediateResultAvailable(E result)
result
- The result.public void commandAvailable(java.lang.Object command)
commandAvailable
in interface IFutureCommandListener
public void resultAvailableIfUndone(java.util.Collection<E> result)
resultAvailableIfUndone
in interface IUndoneResultListener<java.util.Collection<E>>
result
- The result.public void exceptionOccurredIfUndone(java.lang.Exception exception)
exceptionOccurredIfUndone
in interface IUndoneResultListener<java.util.Collection<E>>
exception
- The exception.public void intermediateResultAvailableIfUndone(E result)
intermediateResultAvailableIfUndone
in interface IUndoneIntermediateResultListener<E>
result
- The result.public void finishedIfUndone()
finishedIfUndone
in interface IUndoneIntermediateResultListener<E>