Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GridGain.Compute.ComputeJobAdapter< T > Class Template Referenceabstract

Convenience adapter for IComputeJob<T> implementations. It provides the following functionality: More...

Inherits GridGain.Compute.IComputeJob< T >.

Public Member Functions

void Cancel ()
 This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). More...
 
void SetArguments (params object[] args)
 Sets given arguments. More...
 
TArg Argument< TArg > (int idx)
 Sets given arguments. More...
 
abstract T Execute ()
 Executes this job. More...
 
- Public Member Functions inherited from GridGain.Compute.IComputeJob< T >
T Execute ()
 Executes this job. More...
 
void Cancel ()
 This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). More...
 

Protected Member Functions

 ComputeJobAdapter ()
 No-arg constructor. More...
 
 ComputeJobAdapter (params object[] args)
 Creates job with specified arguments. More...
 
bool IsCancelled ()
 This method tests whether or not this job was cancelled. This method is thread-safe and can be called without extra synchronization. This method can be periodically called in GridGain.Compute.IComputeJob<T>.Execute() method implementation to check whether or not this job cancelled. Note that system calls GridGain.Compute.IComputeJob<T>.Cancel() method only as a hint and this is a responsibility of the implementation of the job to properly cancel its execution. More...
 

Protected Attributes

object[] args
 

Detailed Description

Constructor & Destructor Documentation

GridGain.Compute.ComputeJobAdapter< T >.ComputeJobAdapter ( params object[]  args)
protected
Parameters
argsOptional job arguments.

Member Function Documentation

TArg GridGain.Compute.ComputeJobAdapter< T >.Argument< TArg > ( int  idx)
Parameters
idxIndex of the argument.
void GridGain.Compute.ComputeJobAdapter< T >.Cancel ( )

Note that job cancellation is only a hint, and it is really up to the actual job instance to gracefully finish execution and exit.

abstract T GridGain.Compute.ComputeJobAdapter< T >.Execute ( )
pure virtual
Returns
Job execution result (possibly null). This result will be returned in IComputeJobResult<T> object passed into IComputeTask<A,T,R>.Result on caller node.
bool GridGain.Compute.ComputeJobAdapter< T >.IsCancelled ( )
protected
Returns
True if this job was cancelled, false otherwise.
void GridGain.Compute.ComputeJobAdapter< T >.SetArguments ( params object[]  args)
Parameters
argsOptional job arguments to set.

Member Data Documentation

object [] GridGain.Compute.ComputeJobAdapter< T >.args
protected

Arguments.