GridGain™ 2.0.3
Java API Specification

org.gridgain.grid.gridify
Class GridifyJobAdapter

java.lang.Object
  extended by org.gridgain.grid.GridJobAdapter<GridifyArgument>
      extended by org.gridgain.grid.gridify.GridifyJobAdapter
All Implemented Interfaces:
Serializable, GridJob

public class GridifyJobAdapter
extends GridJobAdapter<GridifyArgument>

Convenience adapter for custom gridify jobs. In addition to functionality provided in GridJobAdapter adapter, this adapter provides default implementation of GridifyJobAdapter.execute() method, which reflectively executes grid-enabled method based on information provided in GridifyArgument parameter.

Note this adapter is only useful when passing GridifyArgument to remote jobs. In many cases, remote jobs will not require GridifyArgument as they will execute their code without reflection, hence the regular GridJobAdapter should be used.

See Gridify documentation for more information about execution of gridified methods.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

Author:   2005-2008 Copyright © GridGain Systems. All Rights Reserved. ver. 2.0.3

See Also:
Gridify, Serialized Form
 

Constructor Summary
GridifyJobAdapter(GridifyArgument arg)
          Initializes job with argument.
 
Method Summary
 Serializable execute()
          Provides default implementation for execution of grid-enabled methods.
 
Methods inherited from class org.gridgain.grid.GridJobAdapter
addArgument, cancel, getAllArguments, getArgument, getArgument, isCancelled, setArgument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridifyJobAdapter

public GridifyJobAdapter(GridifyArgument arg)
Initializes job with argument.

Parameters:
arg - Job argument.
Method Detail

execute

public Serializable execute()
                     throws GridException
Provides default implementation for execution of grid-enabled methods. This method assumes that argument passed in is of GridifyArgument type. It attempts to reflectively execute a method based on information provided in the argument and returns the return value of the method.

If some exception occurred during execution, then it will be thrown out of this method.

Throws:
GridException - If job execution caused an exception. This exception will be returned in GridJobResult.getException() method passed into GridTask.result(GridJobResult, List) method into task on caller node. If execution produces a RuntimeException or Error, then it will be wrapped into GridException.
Returns:
Job execution result (possibly null). This result will be returned in GridJobResult.getData() method passed into GridTask.result(GridJobResult, List) method into task on caller node.

GridGain™ 2.0.3
Java API Specification

GridGain™ - Grid Computing Made Simple, ver. 2.0.3.20052008
2005-2008 Copyright © GridGain Systems. All Rights Reserved.