GridGain™ 2.0.3
Java API Specification

org.gridgain.grid.spi.collision
Interface GridCollisionJobContext


@Apache20LicenseCompatible
public interface GridCollisionJobContext

This interface defines set of operations that collision SPI implementation can perform on jobs that are either waiting or executing.



See Also:

  Documentation
  Email Support
  Online Forums
  Issue Tracking

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

 

Method Summary
 boolean activate()
          Activates the job.
 boolean cancel()
          Cancels the job.
 GridJob getJob()
          Job for this context.
 GridJobContext getJobContext()
          Gets job context.
 UUID getJobId()
          Deprecated. 
 GridTaskSession getTaskSession()
          Gets current task session associated with this job.
 

Method Detail

getTaskSession

GridTaskSession getTaskSession()
Gets current task session associated with this job.

Returns:
Grid task session.

getJobContext

GridJobContext getJobContext()
Gets job context. Use this context to set/get attributes that should be visible only to this job and should not be distributed to other jobs in the grid.

Job context travels with job whenever it gets failed-over to another node, so attributes set on the context on one node will be visible on other nodes this job may potentially end up on.

Returns:
Job context.

getJob

GridJob getJob()
Job for this context.

Returns:
Job for this context.

getJobId

@Deprecated
UUID getJobId()
Deprecated. 

Gets ID of this job. Deprecated in favor of GridCollisionJobContext.getJobContext() which provides job attributes in addition to job ID.

Returns:
Job ID.

activate

boolean activate()
Activates the job. If job is already active this is no-op. Collision resolution is handled concurrently, so it may be possible that other threads already activated or cancelled/rejected this job. This method will return true if it was able to activate the job, and false otherwise.

Returns:
True if it was possible to activate the job, and false otherwise.

cancel

boolean cancel()
Cancels the job. If job was active (executing) method GridJob.cancel() will be called on the job. If job was in wait state, then it will be rejected prior to execution and GridJob.cancel() will not be called.

Collision resolution is handled concurrently, so it may be possible that other threads already activated or cancelled/rejected this job. This method will return true if it was able to cancel/reject the job and false otherwise.

Returns:
True if it was possible to cancel/reject this job, false otherwise.

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.