Package jadex.commons.future
Class UnlimitedIntermediateDelegationResultListener<E>
- java.lang.Object
-
- jadex.commons.future.UnlimitedIntermediateDelegationResultListener<E>
-
- All Implemented Interfaces:
IFunctionalExceptionListener
,IFunctionalIntermediateFinishedListener<E>
,IFunctionalIntermediateResultListener<E>
,IFunctionalResultListener<java.util.Collection<E>>
,IIntermediateResultListener<E>
,IResultListener<java.util.Collection<E>>
public class UnlimitedIntermediateDelegationResultListener<E> extends java.lang.Object implements IIntermediateResultListener<E>
Listener that forwards results but not finished events.
-
-
Field Summary
Fields Modifier and Type Field Description protected IntermediateFuture<E>
delegate
The delegate future.
-
Constructor Summary
Constructors Constructor Description UnlimitedIntermediateDelegationResultListener(IntermediateFuture<E> delegate)
Create a new UnlimitedIntermediateDelegationResultListener.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
finished()
Declare that the future is finished.void
intermediateResultAvailable(E result)
Called when an intermediate result is available.void
resultAvailable(java.util.Collection<E> results)
Called when the result is available.
-
-
-
Field Detail
-
delegate
protected IntermediateFuture<E> delegate
The delegate future.
-
-
Constructor Detail
-
UnlimitedIntermediateDelegationResultListener
public UnlimitedIntermediateDelegationResultListener(IntermediateFuture<E> delegate)
Create a new UnlimitedIntermediateDelegationResultListener.
-
-
Method Detail
-
intermediateResultAvailable
public void intermediateResultAvailable(E result)
Called when an intermediate result is available.- Specified by:
intermediateResultAvailable
in interfaceIFunctionalIntermediateResultListener<E>
- Specified by:
intermediateResultAvailable
in interfaceIIntermediateResultListener<E>
- Parameters:
result
- The result.
-
finished
public 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:
finished
in interfaceIFunctionalIntermediateFinishedListener<E>
- Specified by:
finished
in interfaceIIntermediateResultListener<E>
-
resultAvailable
public void resultAvailable(java.util.Collection<E> results)
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:
resultAvailable
in interfaceIFunctionalResultListener<E>
- Parameters:
result
- The final result.
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIFunctionalExceptionListener
- Parameters:
exception
- The exception.
-
-