Class FlattenMultiplexCollector
- java.lang.Object
-
- jadex.bridge.service.component.multiinvoke.FlattenMultiplexCollector
-
- All Implemented Interfaces:
IMultiplexCollector
,IIntermediateResultListener<java.lang.Object>
,IResultListener<java.util.Collection<java.lang.Object>>
public class FlattenMultiplexCollector extends java.lang.Object implements IMultiplexCollector
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<java.lang.Object>
callresults
The list of results (if ret is not intermediate future).protected java.util.List<Future<java.lang.Void>>
calls
The list of calls.protected boolean
flatten
Flag if flatten.protected Future<java.lang.Object>
fut
The future.
-
Constructor Summary
Constructors Constructor Description FlattenMultiplexCollector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addResult(java.lang.Object result)
Add a result.void
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.void
finished()
Declare that the future is finished.void
init(Future<java.lang.Object> fut, java.lang.reflect.Method method, java.lang.Object[] args, java.lang.reflect.Method muxmethod)
Init to share code.void
intermediateResultAvailable(java.lang.Object result)
Called when an intermediate result is available.void
maxResultCountAvailable(int max)
Declare that the future result count is available.void
resultAvailable(java.util.Collection<java.lang.Object> result)
Called when the result is available.protected void
setException(java.lang.Exception exception)
Set an exception.protected void
setFinished()
Set finished.
-
-
-
Field Detail
-
fut
protected Future<java.lang.Object> fut
The future.
-
flatten
protected boolean flatten
Flag if flatten.
-
calls
protected java.util.List<Future<java.lang.Void>> calls
The list of calls.
-
callresults
protected java.util.List<java.lang.Object> callresults
The list of results (if ret is not intermediate future).
-
-
Method Detail
-
init
public void init(Future<java.lang.Object> fut, java.lang.reflect.Method method, java.lang.Object[] args, java.lang.reflect.Method muxmethod)
Init to share code.- Specified by:
init
in interfaceIMultiplexCollector
-
intermediateResultAvailable
public void intermediateResultAvailable(java.lang.Object result)
Description copied from interface:IIntermediateResultListener
Called when an intermediate result is available.- Specified by:
intermediateResultAvailable
in interfaceIIntermediateResultListener<java.lang.Object>
- Parameters:
result
- The result.
-
finished
public void finished()
Description copied from interface:IIntermediateResultListener
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<java.lang.Object>
-
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<java.lang.Object>
-
resultAvailable
public void resultAvailable(java.util.Collection<java.lang.Object> result)
Description copied from interface:IResultListener
Called when the result is available.- Specified by:
resultAvailable
in interfaceIResultListener<java.util.Collection<java.lang.Object>>
- Parameters:
result
- The result.
-
exceptionOccurred
public void exceptionOccurred(java.lang.Exception exception)
Description copied from interface:IResultListener
Called when an exception occurred.- Specified by:
exceptionOccurred
in interfaceIResultListener<java.util.Collection<java.lang.Object>>
- Parameters:
exception
- The exception.
-
addResult
protected void addResult(java.lang.Object result)
Add a result.- Parameters:
result
- The result.
-
setFinished
protected void setFinished()
Set finished.
-
setException
protected void setException(java.lang.Exception exception)
Set an exception.- Parameters:
exception
- The exception.
-
-