Package jadex.commons.future
Class IntermediateExceptionDelegationResultListener<E,T>
- java.lang.Object
- 
- jadex.commons.future.IntermediateExceptionDelegationResultListener<E,T>
 
- 
- All Implemented Interfaces:
- IFunctionalExceptionListener,- IFunctionalIntermediateFinishedListener<E>,- IFunctionalIntermediateResultCountListener,- 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>>
 
 public class IntermediateExceptionDelegationResultListener<E,T> extends java.lang.Object implements IIntermediateResultListener<E>, IFutureCommandResultListener<java.util.Collection<E>>, IUndoneIntermediateResultListener<E> Exception delegation listener for intermediate futures.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IFunctionalIntermediateResultCountListenerclistenerCustom functional result count listener.protected IFunctionalResultListener<java.lang.Void>flistenerCustom functional finished listenerprotected Future<T>futureThe future to which calls are delegated.protected IFunctionalResultListener<E>irlistenerCustom functional result listenerprotected booleanundoneThe undone flag.
 - 
Constructor SummaryConstructors Constructor Description IntermediateExceptionDelegationResultListener(Future<T> future)Create a new listener.IntermediateExceptionDelegationResultListener(Future<T> future, IFunctionalResultListener<E> irlistener, IFunctionalResultListener<java.lang.Void> flistener, IFunctionalIntermediateResultCountListener clistener)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(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.voidintermediateResultAvailable(E result)Called when an intermediate result is available.voidintermediateResultAvailableIfUndone(E result)Called when an intermediate result is available.booleanisUndone()Get the undone.voidmaxResultCountAvailable(int max)Declare that the future result count 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- 
undoneprotected boolean undone The undone flag.
 - 
irlistenerprotected IFunctionalResultListener<E> irlistener Custom functional result listener
 - 
flistenerprotected IFunctionalResultListener<java.lang.Void> flistener Custom functional finished listener
 - 
clistenerprotected IFunctionalIntermediateResultCountListener clistener Custom functional result count listener.
 
- 
 - 
Constructor Detail- 
IntermediateExceptionDelegationResultListenerpublic IntermediateExceptionDelegationResultListener(Future<T> future, IFunctionalResultListener<E> irlistener, IFunctionalResultListener<java.lang.Void> flistener, IFunctionalIntermediateResultCountListener clistener) Create a new listener.- Parameters:
- future- The delegation target.
- irlistener- Functional intermediate result Listener. Can be- null.
- flistener- Functional finished listener. Can be- null.
 
 
- 
 - 
Method Detail- 
resultAvailablepublic void resultAvailable(java.util.Collection<E> result) Called when the result is available. This method is only called for non-intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method has not been called.- Specified by:
- resultAvailablein interface- IFunctionalResultListener<E>
- Parameters:
- result- The final result.
 
 - 
intermediateResultAvailablepublic 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. 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:
- 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.
 
 - 
maxResultCountAvailablepublic void maxResultCountAvailable(int max) Description copied from interface:IIntermediateResultListenerDeclare that the future result count is available. This method is only called for intermediate futures, i.e. when this method is called it is guaranteed that the intermediateResultAvailable method will be called as often as the result count indicates except an exception occurs.- Specified by:
- maxResultCountAvailablein interface- IFunctionalIntermediateResultCountListener
- Specified by:
- maxResultCountAvailablein interface- IIntermediateResultListener<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>
 
 - 
commandAvailablepublic void commandAvailable(java.lang.Object command) Called when a command is available.- Specified by:
- commandAvailablein interface- IFutureCommandResultListener<E>
 
 - 
isUndonepublic boolean isUndone() Get the undone.- Returns:
- The undone.
 
 
- 
 
-