Class CallableTaskAdapter<T extends Serializable>
java.lang.Object
org.openspaces.core.executor.juc.CallableTaskAdapter<T>
- All Implemented Interfaces:
SmartExternalizable, Externalizable, Serializable, ProcessObjectsProvider, Task<T>, TaskRoutingProvider
- Direct Known Subclasses:
CallableDistributedTaskAdapter
public class CallableTaskAdapter<T extends Serializable>
extends Object
implements Task<T>, ProcessObjectsProvider, TaskRoutingProvider, SmartExternalizable
An adapter allowing to execute a
Callable using Space task executors.- Author:
- kimchy
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHere just for externalizable.CallableTaskAdapter(Callable<T> callable) Constructs a new callable task adapter with the callable tocall. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Simply delegates the execution toCallable.call().Returns the embedded callable.Object[]Returns the callable passed so it will be processed on the node it is executed on as well.Tries to extract the routing information form the task.voidvoidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SmartExternalizable
enabledSmartExternalizableWithReference
-
Constructor Details
-
CallableTaskAdapter
public CallableTaskAdapter()Here just for externalizable. -
CallableTaskAdapter
-
-
Method Details
-
execute
Simply delegates the execution toCallable.call().- Specified by:
executein interfaceTask<T extends Serializable>- Returns:
- computed result
- Throws:
Exception- if unable to compute a result
-
getObjectsToProcess
Returns the callable passed so it will be processed on the node it is executed on as well.- Specified by:
getObjectsToProcessin interfaceProcessObjectsProvider
-
getRouting
Tries to extract the routing information form the task.- Specified by:
getRoutingin interfaceTaskRoutingProvider
-
getCallable
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-