GigaSpaces XAP 9.0 API

com.sun.jini.mahalo
Class Job

java.lang.Object
  extended by com.sun.jini.mahalo.Job
Direct Known Subclasses:
AbortJob, CommitJob, PrepareAndCommitJob, PrepareJob

public abstract class Job
extends Object

A Job manages the division of work for a problem whose solution is obtained by assembling partial results to original problem.

Author:
Sun Microsystems, Inc.

Field Summary
protected  boolean _directCall
           
protected  int pending
           
protected  Object[] results
           
protected  Map tasks
           
 
Constructor Summary
Job(TaskManager pool, WakeupManager wm, boolean directCall)
          Create the Job object giving it the TaskManager responsible for the pool of threads which perform the necessary work.
 
Method Summary
protected  WakeupManager getMgr()
          Returns a reference to the WakeupManager which provides the scheduling of tasks created by this Job
protected  TaskManager getPool()
          Returns a reference to the TaskManager which supplies the threads used to executed tasks created by this Job
 boolean isCompleted(long waitFor)
          Check to see if the Job execution has completed.
 boolean isDirectCall()
           
protected  boolean numberOfRetriesDueToConnectionExceptionExceeded(TaskManager.Task who)
           
protected  void reportDone(TaskManager.Task who, Object param)
           
 void scheduleTasks()
          Schedules tasks for execution
 void stop()
          Halt all of the work being performed by the Job
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pending

protected int pending

results

protected Object[] results

tasks

protected Map tasks

_directCall

protected final boolean _directCall
Constructor Detail

Job

public Job(TaskManager pool,
           WakeupManager wm,
           boolean directCall)
Create the Job object giving it the TaskManager responsible for the pool of threads which perform the necessary work.

Parameters:
pool - the TaskManager which provides the threads
Method Detail

scheduleTasks

public void scheduleTasks()
Schedules tasks for execution


getPool

protected TaskManager getPool()
Returns a reference to the TaskManager which supplies the threads used to executed tasks created by this Job


getMgr

protected WakeupManager getMgr()
Returns a reference to the WakeupManager which provides the scheduling of tasks created by this Job


reportDone

protected void reportDone(TaskManager.Task who,
                          Object param)
                   throws JobException
Throws:
JobException

isCompleted

public boolean isCompleted(long waitFor)
                    throws JobException
Check to see if the Job execution has completed.

Parameters:
waitFor - The amount of time the caller is willing to wait for the completion status to arrive.
Throws:
JobException

stop

public void stop()
Halt all of the work being performed by the Job


isDirectCall

public boolean isDirectCall()

numberOfRetriesDueToConnectionExceptionExceeded

protected boolean numberOfRetriesDueToConnectionExceptionExceeded(TaskManager.Task who)

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.