Package jadex.commons.future
Class DelegationResultListener<E>
- java.lang.Object
- 
- jadex.commons.future.DelegationResultListener<E>
 
- 
- All Implemented Interfaces:
- IFutureCommandResultListener<E>,- IResultListener<E>,- IUndoneResultListener<E>
 - Direct Known Subclasses:
- DecouplingInterceptor.CopyReturnValueResultListener,- PrePostConditionInterceptor.CheckReturnValueResultListener,- TerminableDelegationResultListener,- TracingInterceptor.ReturnValueResultListener
 
 public class DelegationResultListener<E> extends java.lang.Object implements IResultListener<E>, IFutureCommandResultListener<E>, IUndoneResultListener<E> Result listener that delegates calls to a future.
- 
- 
Constructor SummaryConstructors Constructor 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, java.util.function.Consumer<E> customResultListener)Create a new listener.DelegationResultListener(Future<E> future, java.util.function.Consumer<E> customResultListener)Create a new listener.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommandAvailable(java.lang.Object command)Called when a command is available.voidcustomResultAvailable(E result)Called when the result is available.voidexceptionOccurred(java.lang.Exception exception)Called when an exception occurred.voidexceptionOccurredIfUndone(java.lang.Exception exception)Called when an exception occurred.booleanisUndone()Get the undone.voidresultAvailable(E result)Called when the result is available.voidresultAvailableIfUndone(E result)Called when the result is available.
 
- 
- 
- 
Constructor Detail- 
DelegationResultListenerpublic DelegationResultListener(Future<E> future, java.util.function.Consumer<E> customResultListener) Create a new listener.- Parameters:
- future- The delegation target.
- customResultListener- Custom result listener that overwrites the delegation behaviour.
 
 - 
DelegationResultListenerpublic DelegationResultListener(Future<E> future, boolean undone, java.util.function.Consumer<E> customResultListener) Create a new listener.- Parameters:
- future- The delegation target.
- undone- use undone methods.
- customResultListener- Custom result listener that overwrites the delegation behaviour.
 
 
- 
 - 
Method Detail- 
resultAvailablepublic final void resultAvailable(E result) Called when the result is available.- Specified by:
- resultAvailablein interface- IResultListener<E>
- Parameters:
- result- The result.
 
 - 
customResultAvailablepublic void customResultAvailable(E result) Called when the result is available.- Parameters:
- result- The result.
 
 - 
exceptionOccurredpublic void exceptionOccurred(java.lang.Exception exception) Called when an exception occurred.- Specified by:
- exceptionOccurredin interface- IResultListener<E>
- Parameters:
- exception- The exception.
 
 - 
commandAvailablepublic void commandAvailable(java.lang.Object command) Called when a command is available.- Specified by:
- commandAvailablein interface- IFutureCommandResultListener<E>
 
 - 
resultAvailableIfUndonepublic void resultAvailableIfUndone(E result) Called when the result is available.- Specified by:
- resultAvailableIfUndonein interface- IUndoneResultListener<E>
- Parameters:
- result- The result.
 
 - 
exceptionOccurredIfUndonepublic void exceptionOccurredIfUndone(java.lang.Exception exception) Called when an exception occurred.- Specified by:
- exceptionOccurredIfUndonein interface- IUndoneResultListener<E>
- Parameters:
- exception- The exception.
 
 - 
isUndonepublic boolean isUndone() Get the undone.- Returns:
- The undone.
 
 
- 
 
-