GigaSpaces XAP 9.0 API

org.openspaces.core.executor.support
Class PrivilegedDistributedTask<T extends Serializable,R>

java.lang.Object
  extended by org.openspaces.core.executor.support.SimpleDelegatingTask<T>
      extended by org.openspaces.core.executor.support.AbstractDelegatingDistributedTask<T,R>
          extended by org.openspaces.core.executor.support.PrivilegedDistributedTask<T,R>
All Implemented Interfaces:
AsyncResultFilter<T>, AsyncResultsReducer<T,R>, Externalizable, Serializable, DistributedTask<T,R>, DelegatingTask<T>, Task<T>, TaskRoutingProvider

public class PrivilegedDistributedTask<T extends Serializable,R>
extends AbstractDelegatingDistributedTask<T,R>
implements Externalizable

A delegating distrubuted task (with an optional filter) that runs under established access control settings.

Author:
kimchy
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.gigaspaces.async.AsyncResultFilter
AsyncResultFilter.Decision
 
Constructor Summary
PrivilegedDistributedTask()
          Here for Externalizable.
PrivilegedDistributedTask(DistributedTask<T,R> task)
          Constructs a new privileged task wrapping the actual task to execute.
PrivilegedDistributedTask(DistributedTask<T,R> task, AsyncResultFilter<T> filter)
          Constructs a new privileged task wrapping the actual task and filter to execute.
 
Method Summary
 T execute()
          Exeutes the provided task under access controls.
 AsyncResultFilter.Decision onResult(AsyncResultFilterEvent<T> event)
          Executes the filter (if provided) under access controls.
 void readExternal(ObjectInput in)
           
 R reduce(List<AsyncResult<T>> results)
          Reduces the provided task under access controls.
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class org.openspaces.core.executor.support.AbstractDelegatingDistributedTask
_readExternal, _writeExternal, getFilter
 
Methods inherited from class org.openspaces.core.executor.support.SimpleDelegatingTask
getDelegatedTask, getRouting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivilegedDistributedTask

public PrivilegedDistributedTask()
Here for Externalizable.


PrivilegedDistributedTask

public PrivilegedDistributedTask(DistributedTask<T,R> task)
Constructs a new privileged task wrapping the actual task to execute.


PrivilegedDistributedTask

public PrivilegedDistributedTask(DistributedTask<T,R> task,
                                 AsyncResultFilter<T> filter)
Constructs a new privileged task wrapping the actual task and filter to execute.

Method Detail

execute

public T execute()
                               throws Exception
Exeutes the provided task under access controls.

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

reduce

public R reduce(List<AsyncResult<T>> results)
         throws Exception
Reduces the provided task under access controls.

Specified by:
reduce in interface AsyncResultsReducer<T extends Serializable,R>
Throws:
Exception

onResult

public AsyncResultFilter.Decision onResult(AsyncResultFilterEvent<T> event)
Executes the filter (if provided) under access controls.

Specified by:
onResult in interface AsyncResultFilter<T extends Serializable>
Overrides:
onResult in class AbstractDelegatingDistributedTask<T extends Serializable,R>

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.