GigaSpaces XAP 7.0 API

org.openspaces.core.executor.support
Class SimpleDelegatingTask<T extends Serializable>

java.lang.Object
  extended by org.openspaces.core.executor.support.SimpleDelegatingTask<T>
All Implemented Interfaces:
Serializable, DelegatingTask<T>, Task<T>, TaskRoutingProvider
Direct Known Subclasses:
AbstractDelegatingDistributedTask, PrivilegedTask

public class SimpleDelegatingTask<T extends Serializable>
extends Object
implements DelegatingTask<T>, TaskRoutingProvider

A simple impelemntation of delegating task that accepts the task to delegate to.

Author:
kimchy
See Also:
Serialized Form

Constructor Summary
protected SimpleDelegatingTask()
           
  SimpleDelegatingTask(Task<T> task)
          Constructs a new simple delegating task with the task to delegate to.
 
Method Summary
protected  void _readExternal(ObjectInput input)
           
protected  void _writeExternal(ObjectOutput output)
           
 T execute()
          Simply delegates the execution to the provided delegated task.
 Task<T> getDelegatedTask()
          Returns the delegated task the task will execute to.
 Object getRouting()
          Tries to extract the routing information form the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleDelegatingTask

protected SimpleDelegatingTask()

SimpleDelegatingTask

public SimpleDelegatingTask(Task<T> task)
Constructs a new simple delegating task with the task to delegate to.

Method Detail

getDelegatedTask

public Task<T> getDelegatedTask()
Returns the delegated task the task will execute to.

Specified by:
getDelegatedTask in interface DelegatingTask<T extends Serializable>

getRouting

public Object getRouting()
Tries to extract the routing information form the task.

Specified by:
getRouting in interface TaskRoutingProvider

execute

public T execute()
                               throws Exception
Simply delegates the execution to the provided delegated task.

Specified by:
execute in interface Task<T extends Serializable>
Returns:
computed result
Throws:
Exception - if unable to compute a result

_writeExternal

protected void _writeExternal(ObjectOutput output)
                       throws IOException
Throws:
IOException

_readExternal

protected void _readExternal(ObjectInput input)
                      throws IOException,
                             ClassNotFoundException
Throws:
IOException
ClassNotFoundException

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.