Package jadex.future
Class IntermediateDefaultResultListener<E>
- All Implemented Interfaces:
IFutureCommandResultListener<Collection<E>>
,IIntermediateResultListener<E>
,IResultListener<Collection<E>>
public class IntermediateDefaultResultListener<E>
extends DefaultResultListener<Collection<E>>
implements IIntermediateResultListener<E>
The default listener for just printing out result information.
Is used as fallback when no other listener is available.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new listener.Create a new listener. -
Method Summary
Modifier and TypeMethodDescriptionvoid
finished()
Declare that the future is finished.void
intermediateResultAvailable
(E result) Called when an intermediate result is available.void
maxResultCountAvailable
(int max) Declare that the future result count is available.void
resultAvailable
(Collection<E> result) Called when the result is available.Methods inherited from class jadex.future.DefaultResultListener
commandAvailable, exceptionOccurred
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface jadex.future.IResultListener
exceptionOccurred
-
Constructor Details
-
IntermediateDefaultResultListener
public IntermediateDefaultResultListener()Create a new listener. -
IntermediateDefaultResultListener
Create a new listener.- Parameters:
logger
- The logger.
-
-
Method Details
-
intermediateResultAvailable
Called when an intermediate result is available.- 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 interfaceIIntermediateResultListener<E>
-
resultAvailable
Called when the result is available.- Specified by:
resultAvailable
in interfaceIResultListener<E>
- Parameters:
result
- The result.
-
maxResultCountAvailable
public void maxResultCountAvailable(int max) Description copied from interface:IIntermediateResultListener
Declare 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:
maxResultCountAvailable
in interfaceIIntermediateResultListener<E>
-