org.apache.ignite.internal.util.gridify

## Class GridifyJobAdapter

- java.lang.Object
- - org.apache.ignite.compute.ComputeJobAdapter
  - - org.apache.ignite.internal.util.gridify.GridifyJobAdapter

All Implemented Interfaces:
  Serializable, Callable<Object>, ComputeJob

    public class GridifyJobAdapter
    extends ComputeJobAdapter

Convenience adapter for custom `gridify` jobs. In addition to functionality provided in `ComputeJobAdapter` adapter, this adapter provides default implementation of `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 `ComputeJobAdapter` should be used.

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

See Also:
  `Gridify`, Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridifyJobAdapter(GridifyArgument arg)` Initializes job with argument.

### Method Summary

Methods
`Object` `execute()` Provides default implementation for execution of grid-enabled methods.

### Methods inherited from class org.apache.ignite.compute.ComputeJobAdapter

`argument, call, cancel, isCancelled, setArguments`

### 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 Object execute()

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.

Returns:
  Job execution result (possibly `null`). This result will be returned in `ComputeJobResult.getData()` method passed into `ComputeTask.result(ComputeJobResult, List)` task method on caller node.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015