org.apache.ignite.internal.processors.job

## Class GridJobWorker

- java.lang.Object
- - org.apache.ignite.internal.util.worker.GridWorker
  - - org.apache.ignite.internal.processors.job.GridJobWorker

All Implemented Interfaces:
  Runnable, GridTimeoutObject

    public class GridJobWorker
    extends GridWorker
    implements GridTimeoutObject

Job worker.

### Method Summary

Methods
`protected void` `body()` The implementation should provide the execution body for this runnable.
`void` `cancel()` Cancels this runnable interrupting actual runner.
`void` `cancel(boolean sys)`
`long` `endTime()`
`boolean` `equals(Object obj)`
`void` `execute()` Executes the job.
`GridDeployment` `getDeployment()`
`ComputeJob` `getJob()` Gets deployed job or `null` of job could not be deployed.
`ComputeJobContext` `getJobContext()`
`IgniteUuid` `getJobId()`
`GridJobSessionImpl` `getSession()`
`int` `hashCode()`
`boolean` `held()`
`boolean` `hold()` Sets halt flags.
`boolean` `isInternal()`
`void` `onStopping()` Callback for whenever grid is stopping.
`void` `onTimeout()` Timeout callback.
`IgniteUuid` `timeoutId()`
`String` `toString()`

### Methods inherited from class org.apache.ignite.internal.util.worker.GridWorker

`cleanup, gridName, isCancelled, isDone, join, name, run, runner`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Method Detail

#### getJob

    @Nullable
    public ComputeJob getJob()

Gets deployed job or `null` of job could not be deployed.

Returns:
  Deployed job.

#### getDeployment

    public GridDeployment getDeployment()

Returns:
  Deployed task.

#### getJobId

    public IgniteUuid getJobId()

Returns:
  Unique job ID.

#### getJobContext

    public ComputeJobContext getJobContext()

Returns:
  Job context.

#### getSession

    public GridJobSessionImpl getSession()

Returns:
  Session.

#### endTime

    public long endTime()

Specified by:
  `endTime` in interface `GridTimeoutObject`
Returns:
  End time.

#### timeoutId

    public IgniteUuid timeoutId()

Specified by:
  `timeoutId` in interface `GridTimeoutObject`
Returns:
  ID of the object.

#### isInternal

    public boolean isInternal()

Returns:
  `True` if parent task is internal or Visor-related.

#### onTimeout

    public void onTimeout()

Timeout callback.

Specified by:
  `onTimeout` in interface `GridTimeoutObject`

#### onStopping

    public void onStopping()

Callback for whenever grid is stopping.

#### held

    public boolean held()

Returns:
  `True` if job was halted.

#### hold

    public boolean hold()

Sets halt flags.

#### body

    protected void body()

The implementation should provide the execution body for this runnable.

Specified by:
  `body` in class `GridWorker`

#### execute

    public void execute()

Executes the job.

#### cancel

    public void cancel()

Cancels this runnable interrupting actual runner.

Overrides:
  `cancel` in class `GridWorker`

#### cancel

    public void cancel(boolean sys)

Parameters:
  `sys` - System flag.

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `GridWorker`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.3.0-incubating
Release Date | : July 10 2015