public class CallableDistributedTaskAdapter<T extends Serializable,R> extends CallableTaskAdapter<T> implements DistributedTask<T,R>, AsyncResultFilter<T>
Callable
in a distributed fashion.
In such a case, a AsyncResultsReducer
must be implemented or
provided (see the different constructors). An optional AsyncResultFilter
can be also implemented or provided.AsyncResultFilter.Decision
Constructor and Description |
---|
CallableDistributedTaskAdapter()
Here just for externalizable.
|
CallableDistributedTaskAdapter(Callable<T> callable)
Constructs a new callable distributed task adapter.
|
CallableDistributedTaskAdapter(Callable<T> callable,
AsyncResultsReducer<T,R> reducer)
Constructs a new callable distributed task adapter with a separate reducer.
|
CallableDistributedTaskAdapter(Callable<T> callable,
AsyncResultsReducer<T,R> reducer,
AsyncResultFilter<T> filter)
Constructs a new callable distributed task adapter with a separate reducer and filter.
|
Modifier and Type | Method and Description |
---|---|
AsyncResultFilter.Decision |
onResult(AsyncResultFilterEvent<T> event)
If a filter is provided in one of the constructor methods, will delegate the call to it.
|
void |
readExternal(ObjectInput in) |
R |
reduce(List<AsyncResult<T>> results)
Delegates the call to the provided reducer.
|
void |
writeExternal(ObjectOutput out) |
execute, getCallable, getObjectsToProcess, getRouting
public CallableDistributedTaskAdapter()
public CallableDistributedTaskAdapter(Callable<T> callable) throws IllegalArgumentException
AsyncResultFilter
.IllegalArgumentException
public CallableDistributedTaskAdapter(Callable<T> callable, AsyncResultsReducer<T,R> reducer) throws IllegalArgumentException
AsyncResultFilter
.IllegalArgumentException
public CallableDistributedTaskAdapter(Callable<T> callable, AsyncResultsReducer<T,R> reducer, AsyncResultFilter<T> filter) throws IllegalArgumentException
IllegalArgumentException
public R reduce(List<AsyncResult<T>> results) throws Exception
reduce
in interface AsyncResultsReducer<T extends Serializable,R>
Exception
public AsyncResultFilter.Decision onResult(AsyncResultFilterEvent<T> event)
AsyncResultFilter.Decision.CONTINUE
.onResult
in interface AsyncResultFilter<T extends Serializable>
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class CallableTaskAdapter<T extends Serializable>
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class CallableTaskAdapter<T extends Serializable>
IOException
ClassNotFoundException
Copyright © GigaSpaces.