com.sun.grid.jgrid
Interface Computable

All Superinterfaces:
java.io.Serializable

public interface Computable
extends java.io.Serializable

This interface marks a class that can be executed by the compute engine.


Method Summary
 void cancel()
          This method cancels a running job.
 void checkpoint()
          This method is used to tell the job that a checkpoint is imminent and that it should save its state now.
 java.io.Serializable compute(Job job)
          This method causes this class to execute
 void resume()
          This method resumes a suspended job.
 void suspend()
          This methods suspend a running job.
 

Method Detail

compute

public java.io.Serializable compute(Job job)
                             throws ComputeException
This method causes this class to execute

Parameters:
job - The Job object associated with this job. The Job object is used to access additional information about the job, such as job id and properties and is used to access the compute engine logging mechanism.
Returns:
the results object
Throws:
ComputeException - if an error occurs during execution

checkpoint

public void checkpoint()
                throws NotInterruptableException
This method is used to tell the job that a checkpoint is imminent and that it should save its state now. The checkpoint will not occur until this method returns. For tasks that have to complete a cycle before being interrupted, this method should block until the task can be interrupted and the state saved.

Throws:
NotInterruptableException - Thrown when the implemetation does not allow the job to be interrupted for checkpointing.

cancel

public void cancel()
            throws NotInterruptableException
This method cancels a running job. It does not need to wait for the job to stop before returning. It only needs to set into certain motion the process of halting the job.

Throws:
NotInterruptableException - Thrown when the implemetation does not allow the job to be interrupted for cancelation.

suspend

public void suspend()
             throws NotInterruptableException
This methods suspend a running job. It does not need to wait for the job to stop before returning. It only needs to set into certain motion the process of suspending the job.

Throws:
NotInterruptableException - Thrown when the implemetation does not allow the job to be interrupted for suspension.

resume

public void resume()
This method resumes a suspended job. If called on a running job, the method call will have no effect.