Package jadex.future
Class ExceptionDelegationResultListener<E,T>
java.lang.Object
jadex.future.ExceptionDelegationResultListener<E,T>
- All Implemented Interfaces:
IFutureCommandResultListener<E>
,IResultListener<E>
,IUndoneResultListener<E>
public abstract class ExceptionDelegationResultListener<E,T>
extends Object
implements IResultListener<E>, IFutureCommandResultListener<E>, IUndoneResultListener<E>
Result listener that delegates calls to a future.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExceptionDelegationResultListener
(Future<T> future) Create a new listener.ExceptionDelegationResultListener
(Future<T> future, boolean undone) Create a new listener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commandAvailable
(Object command) Called when a command is available.abstract void
customResultAvailable
(E result) Called when the result is available.void
exceptionOccurred
(Exception exception) Called when an exception occurred.void
exceptionOccurredIfUndone
(Exception exception) Called when an exception occurred.boolean
isUndone()
Get the undone.final void
resultAvailable
(E result) Called when the result is available.void
resultAvailableIfUndone
(E result) Called when the result is available.
-
Field Details
-
future
The future to which calls are delegated. -
undone
protected boolean undoneFlag if undone methods should be used.
-
-
Constructor Details
-
ExceptionDelegationResultListener
Create a new listener.- Parameters:
future
- The delegation target.
-
ExceptionDelegationResultListener
Create a new listener.- Parameters:
future
- The delegation target.undone
- use undone methods.
-
-
Method Details
-
resultAvailable
Called when the result is available.- Specified by:
resultAvailable
in interfaceIResultListener<E>
- Parameters:
result
- The result.
-
customResultAvailable
Called when the result is available.- Parameters:
result
- The result.- Throws:
Exception
-
exceptionOccurred
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIResultListener<E>
- Parameters:
exception
- The exception.
-
resultAvailableIfUndone
Called when the result is available.- Specified by:
resultAvailableIfUndone
in interfaceIUndoneResultListener<E>
- Parameters:
result
- The result.
-
exceptionOccurredIfUndone
Called when an exception occurred.- Specified by:
exceptionOccurredIfUndone
in interfaceIUndoneResultListener<E>
- Parameters:
exception
- The exception.
-
isUndone
public boolean isUndone()Get the undone.- Returns:
- The undone.
-
commandAvailable
Called when a command is available.- Specified by:
commandAvailable
in interfaceIFutureCommandResultListener<E>
-