public class ExecutorRemotingTask<T extends Serializable> extends Object implements DistributedTask<ExecutorRemotingTask.InternalExecutorResult<T>,List<AsyncResult<ExecutorRemotingTask.InternalExecutorResult<T>>>>, ApplicationContextAware, ClusterInfoAware, TaskRoutingProvider, SpaceRemotingInvocation, Externalizable
Task that can be used to simulate remote invocation with
SpaceRemotingServiceExporter. When executed, the task searches
for a service exporter (first under the hardwired name serviceExporter, then any
bean that define this class), and based on parameters passed on the task itself (such as method
name, lookup name and arguments) invokes service methods that are registered with the service
exporter.| Modifier and Type | Class and Description |
|---|---|
static class |
ExecutorRemotingTask.InternalExecutorException
A wrapper executor exception that holds more information on the exception, such as the instance id.
|
static class |
ExecutorRemotingTask.InternalExecutorResult<T extends Serializable>
A wrapper executor result that holds more information on the exception, such as the instance id.
|
| Constructor and Description |
|---|
ExecutorRemotingTask()
Should not be used.
|
ExecutorRemotingTask(String lookupName,
String methodName,
RemotingUtils.MethodHash methodHash,
Object[] arguments) |
public ExecutorRemotingTask()
public ExecutorRemotingTask(String lookupName, String methodName, RemotingUtils.MethodHash methodHash, Object[] arguments)
public void setApplicationContext(ApplicationContext applicationContext)
setApplicationContext in interface ApplicationContextAwarepublic void setClusterInfo(ClusterInfo clusterInfo)
ClusterInfoAwareNote, the cluster information is obtained externally from the application context which means
that this feature need to be supported by specific containers (and is not supported by plain
Spring application context). This means that beans that implement ClusterInfoAware
should take into account the fact that the cluster info provided might be null.
setClusterInfo in interface ClusterInfoAwareclusterInfo - The cluster information to be injectedpublic void setServiceExporter(SpaceRemotingServiceExporter serviceExporter)
public ExecutorRemotingTask.InternalExecutorResult<T> execute() throws Exception
Taskexecute in interface Task<ExecutorRemotingTask.InternalExecutorResult<T extends Serializable>>Exception - if unable to compute a resultpublic static SpaceRemotingServiceExporter getServiceExporter(ApplicationContext applicationContext)
public List<AsyncResult<ExecutorRemotingTask.InternalExecutorResult<T>>> reduce(List<AsyncResult<ExecutorRemotingTask.InternalExecutorResult<T>>> results) throws Exception
reduce in interface AsyncResultsReducer<ExecutorRemotingTask.InternalExecutorResult<T extends Serializable>,List<AsyncResult<ExecutorRemotingTask.InternalExecutorResult<T extends Serializable>>>>Exceptionpublic Integer getRouting()
TaskRoutingProvidergetRouting in interface TaskRoutingProvidergetRouting in interface SpaceRemotingInvocationpublic String getLookupName()
SpaceRemotingInvocationgetLookupName in interface SpaceRemotingInvocationpublic String getMethodName()
SpaceRemotingInvocationgetMethodName in interface SpaceRemotingInvocationpublic RemotingUtils.MethodHash getMethodHash()
public Object[] getArguments()
SpaceRemotingInvocationgetArguments in interface SpaceRemotingInvocationpublic Object[] getMetaArguments()
SpaceRemotingInvocationgetMetaArguments in interface SpaceRemotingInvocationpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizableIOExceptionClassNotFoundExceptionCopyright © GigaSpaces.