public class CallableTaskAdapter<T extends Serializable> extends Object implements Task<T>, ProcessObjectsProvider, TaskRoutingProvider, Externalizable
Callable
using Space task executors.Constructor and Description |
---|
CallableTaskAdapter()
Here just for externalizable.
|
CallableTaskAdapter(Callable<T> callable)
Constructs a new callable task adapter with the callable to
call . |
Modifier and Type | Method and Description |
---|---|
T |
execute()
Simply delegates the execution to
Callable.call() . |
protected Callable<T> |
getCallable()
Returns the embedded callable.
|
Object[] |
getObjectsToProcess()
Returns the callable passed so it will be processed on the node it is executed on as well.
|
Object |
getRouting()
Tries to extract the routing information form the task.
|
void |
readExternal(ObjectInput in) |
void |
writeExternal(ObjectOutput out) |
public T execute() throws Exception
Callable.call()
.execute
in interface Task<T extends Serializable>
Exception
- if unable to compute a resultpublic Object[] getObjectsToProcess()
getObjectsToProcess
in interface ProcessObjectsProvider
public Object getRouting()
getRouting
in interface TaskRoutingProvider
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
IOException
ClassNotFoundException
Copyright © GigaSpaces.