com.sun.grid.server
Class Job

java.lang.Object
  |
  +--com.sun.grid.server.Job
All Implemented Interfaces:
Computable, java.io.Serializable

public class Job
extends java.lang.Object
implements java.io.Serializable, Computable

This class represents a job to be executed by the compute engine.

See Also:
Serialized Form

Field Summary
private  boolean asynch
          Whether this job is to be executed asynchronously or not
private  Computable job
          The object to process
private  java.lang.String jobId
          The id of this job
 
Constructor Summary
Job(java.lang.String jobId, Computable job)
          Creates a new instance of Job
Job(java.lang.String jobId, Computable job, boolean asynch)
          Creates a new instance of Job
 
Method Summary
 java.io.Serializable compute()
          This method causes the job to be executed.
 Computable getJob()
          Returns the object to process
 java.lang.String getJobId()
          Returns the id of this job
 boolean isAsynch()
          Returns whether or not this job should be executed asynchronously
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jobId

private java.lang.String jobId
The id of this job


job

private Computable job
The object to process


asynch

private boolean asynch
Whether this job is to be executed asynchronously or not

Constructor Detail

Job

public Job(java.lang.String jobId,
           Computable job)
Creates a new instance of Job

Parameters:
jobId - the id of this job
job - the object to process

Job

public Job(java.lang.String jobId,
           Computable job,
           boolean asynch)
Creates a new instance of Job

Parameters:
jobId - the id of this job
job - the object to process
asynch - whether this job should be executed asynchronously
Method Detail

getJobId

public java.lang.String getJobId()
Returns the id of this job

Returns:
this job's id

getJob

public Computable getJob()
Returns the object to process

Returns:
the object to process

isAsynch

public boolean isAsynch()
Returns whether or not this job should be executed asynchronously

Returns:
whether this job should be executed asynchronously

compute

public java.io.Serializable compute()
                             throws ComputeException
This method causes the job to be executed.

Specified by:
compute in interface Computable
Returns:
the results object
Throws:
ComputeException - If an error occurs during execution