Package jadex.commons.future
Class IntermediateDelegationResultListener<E>
- java.lang.Object
- 
- jadex.commons.future.IntermediateDelegationResultListener<E>
 
- 
- All Implemented Interfaces:
- IFunctionalExceptionListener,- IFunctionalIntermediateFinishedListener<E>,- IFunctionalIntermediateResultListener<E>,- IFunctionalResultListener<java.util.Collection<E>>,- IFutureCommandResultListener<java.util.Collection<E>>,- IIntermediateResultListener<E>,- IResultListener<java.util.Collection<E>>,- IUndoneIntermediateResultListener<E>,- IUndoneResultListener<java.util.Collection<E>>
 - Direct Known Subclasses:
- DuplicateRemovalIntermediateResultListener,- TerminableIntermediateDelegationResultListener
 
 public class IntermediateDelegationResultListener<E> extends java.lang.Object implements IIntermediateResultListener<E>, IFutureCommandResultListener<java.util.Collection<E>>, IUndoneIntermediateResultListener<E> Intermediate version of the delegation result listener.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IFunctionalIntermediateResultListener<E>customIntermediateResultListenerCustom functional intermediate result listenerprotected IFunctionalResultListener<java.util.Collection<E>>customResultListenerCustom functional result listenerprotected IIntermediateResultListener<E>delegateCustom functional result listenerprotected IntermediateFuture<E>futureThe future to which calls are delegated.protected booleanundoneFlag if undone methods should be used.
 - 
Constructor SummaryConstructors Constructor Description IntermediateDelegationResultListener(IIntermediateResultListener<E> delegate)Create a new listener.IntermediateDelegationResultListener(IIntermediateResultListener<E> delegate, boolean undone)Create a new listener.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<java.util.Collection<E>> customResultListener, IFunctionalIntermediateResultListener<E> customIntermediateResultListener)Create a new listener.IntermediateDelegationResultListener(IntermediateFuture<E> future, IFunctionalResultListener<java.util.Collection<E>> customResultListener, IFunctionalIntermediateResultListener<E> customIntermediateResultListener)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.voidcustomIntermediateResultAvailable(E result)Called when an intermediate result is available.voidcustomResultAvailable(java.util.Collection<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.voidfinished()Declare that the future is finished.voidfinishedIfUndone()Declare that the future is finished.protected voidhandleException(java.lang.Exception e)Handle an exception.voidintermediateResultAvailable(E result)Called when an intermediate result is available.voidintermediateResultAvailableIfUndone(E result)Called when an intermediate result is available.voidresultAvailable(java.util.Collection<E> result)Called when the result is available.voidresultAvailableIfUndone(java.util.Collection<E> result)Called when the result is available.
 
- 
- 
- 
Field Detail- 
futureprotected IntermediateFuture<E> future The future to which calls are delegated.
 - 
undoneprotected boolean undone Flag if undone methods should be used.
 - 
delegateprotected IIntermediateResultListener<E> delegate Custom functional result listener
 - 
customResultListenerprotected IFunctionalResultListener<java.util.Collection<E>> customResultListener Custom functional result listener
 - 
customIntermediateResultListenerprotected IFunctionalIntermediateResultListener<E> customIntermediateResultListener Custom functional intermediate result listener
 
- 
 - 
Constructor Detail- 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IIntermediateResultListener<E> delegate) Create a new listener.- Parameters:
- delegate- The delegation target.
 
 - 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IIntermediateResultListener<E> delegate, boolean undone) Create a new listener.- Parameters:
- delegate- The delegation target.
- undone- use undone methods.
 
 - 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IntermediateFuture<E> future) Create a new listener.- Parameters:
- future- The delegation target.
 
 - 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IntermediateFuture<E> future, IFunctionalResultListener<java.util.Collection<E>> customResultListener, IFunctionalIntermediateResultListener<E> customIntermediateResultListener) Create a new listener.- Parameters:
- future- The delegation target.
- customResultListener- Custom result listener that overwrites the delegation behaviour.
- customIntermediateResultListener- Custom intermediate result listener that overwrites the delegation behaviour.
 
 - 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IntermediateFuture<E> future, boolean undone) Create a new listener.- Parameters:
- future- The delegation target.
- undone- use undone methods.
 
 - 
IntermediateDelegationResultListenerpublic IntermediateDelegationResultListener(IntermediateFuture<E> future, boolean undone, IFunctionalResultListener<java.util.Collection<E>> customResultListener, IFunctionalIntermediateResultListener<E> customIntermediateResultListener) Create a new listener.- Parameters:
- future- The delegation target.
- undone- use undone methods.
- customResultListener- Custom result listener that overwrites the delegation behaviour.
- customIntermediateResultListener- Custom intermediate result listener that overwrites the delegation behaviour.
 
 
- 
 - 
Method Detail- 
resultAvailablepublic final void resultAvailable(java.util.Collection<E> result) Called when the result is available.- Specified by:
- resultAvailablein interface- IFunctionalResultListener<E>
- Parameters:
- result- The result.
 
 - 
intermediateResultAvailablepublic final void intermediateResultAvailable(E result) Called when an intermediate result is available.- Specified by:
- intermediateResultAvailablein interface- IFunctionalIntermediateResultListener<E>
- Specified by:
- intermediateResultAvailablein interface- IIntermediateResultListener<E>
- Parameters:
- result- The result.
 
 - 
finishedpublic void finished() Declare that the future is finished.- Specified by:
- finishedin interface- IFunctionalIntermediateFinishedListener<E>
- Specified by:
- finishedin interface- IIntermediateResultListener<E>
 
 - 
customResultAvailablepublic void customResultAvailable(java.util.Collection<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- IFunctionalExceptionListener
- Parameters:
- exception- The exception.
 
 - 
customIntermediateResultAvailablepublic void customIntermediateResultAvailable(E result) Called when an intermediate result is available.- Parameters:
- result- The result.
 
 - 
commandAvailablepublic void commandAvailable(java.lang.Object command) Called when a command is available.- Specified by:
- commandAvailablein interface- IFutureCommandResultListener<E>
 
 - 
resultAvailableIfUndonepublic void resultAvailableIfUndone(java.util.Collection<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.
 
 - 
intermediateResultAvailableIfUndonepublic void intermediateResultAvailableIfUndone(E result) Called when an intermediate result is available.- Specified by:
- intermediateResultAvailableIfUndonein interface- IUndoneIntermediateResultListener<E>
- Parameters:
- result- The result.
 
 - 
finishedIfUndonepublic void finishedIfUndone() Declare that the future is finished. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method was called for all intermediate results before.- Specified by:
- finishedIfUndonein interface- IUndoneIntermediateResultListener<E>
 
 - 
handleExceptionprotected void handleException(java.lang.Exception e) Handle an exception.
 
- 
 
-