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 TypeMethodDescriptionvoidcommandAvailable(Object command) Called when a command is available.abstract voidcustomResultAvailable(E result) Called when the result is available.voidexceptionOccurred(Exception exception) Called when an exception occurred.voidexceptionOccurredIfUndone(Exception exception) Called when an exception occurred.booleanisUndone()Get the undone.final voidresultAvailable(E result) Called when the result is available.voidresultAvailableIfUndone(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:
resultAvailablein 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:
exceptionOccurredin interfaceIResultListener<E>- Parameters:
exception- The exception.
-
resultAvailableIfUndone
Called when the result is available.- Specified by:
resultAvailableIfUndonein interfaceIUndoneResultListener<E>- Parameters:
result- The result.
-
exceptionOccurredIfUndone
Called when an exception occurred.- Specified by:
exceptionOccurredIfUndonein 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:
commandAvailablein interfaceIFutureCommandResultListener<E>
-