public class IntermediateExceptionDelegationResultListener<E,T> extends java.lang.Object implements IIntermediateResultListener<E>, IFutureCommandListener, IUndoneIntermediateResultListener<E>
Modifier and Type | Field and Description |
---|---|
protected IFunctionalResultListener<java.lang.Void> |
finishedListener
Custom functional finished listener
|
protected Future<T> |
future
The future to which calls are delegated.
|
protected IFunctionalResultListener<E> |
intermediateResultListener
Custom functional result listener
|
protected boolean |
undone
The undone flag.
|
Constructor and Description |
---|
IntermediateExceptionDelegationResultListener(Future<T> future)
Create a new listener.
|
IntermediateExceptionDelegationResultListener(Future<T> future,
IFunctionalResultListener<E> intermediateResultListener,
IFunctionalResultListener<java.lang.Void> finishedListener)
Create a new listener.
|
Modifier and Type | Method and Description |
---|---|
void |
commandAvailable(java.lang.Object command)
Called when a command 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.
|
boolean |
isUndone()
Get the undone.
|
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 boolean undone
protected IFunctionalResultListener<E> intermediateResultListener
protected IFunctionalResultListener<java.lang.Void> finishedListener
public IntermediateExceptionDelegationResultListener(Future<T> future, IFunctionalResultListener<E> intermediateResultListener, IFunctionalResultListener<java.lang.Void> finishedListener)
future
- The delegation target.intermediateResultListener
- Functional intermediate result
Listener. Can be null
.finishedListener
- Functional finished listener. Can be
null
.public void resultAvailable(java.util.Collection<E> result)
resultAvailable
in interface IFunctionalResultListener<java.util.Collection<E>>
resultAvailable
in interface IIntermediateResultListener<E>
result
- The final result.public void intermediateResultAvailable(E result)
intermediateResultAvailable
in interface IFunctionalIntermediateResultListener<E>
intermediateResultAvailable
in interface IIntermediateResultListener<E>
result
- The result.public void finished()
finished
in interface IFunctionalIntermediateFinishedListener
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 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>
public void commandAvailable(java.lang.Object command)
commandAvailable
in interface IFutureCommandListener
public boolean isUndone()