com.sun.grid.jgrid
Interface ComputeEngine

All Superinterfaces:
java.rmi.Remote, java.io.Serializable
All Known Implementing Classes:
ComputeEngineImpl, ComputeServer, ComputeServer_Stub

public interface ComputeEngine
extends java.io.Serializable, java.rmi.Remote

This class is the interface to the ComputeEngine that clients see. It allows clients to submit jobs both synchronously and asynchronously and check on the results of asynchronous jobs.

Since:
0.1

Method Summary
 java.io.Serializable compute(Computable job)
          This method submits a job for synchrnous execution.
 java.io.Serializable compute(Computable job, java.lang.String codebase)
          This method submits a job for synchrnous execution.
 java.lang.String computeAsynch(Computable job)
          This method submits a job for asynchronous execution.
 java.lang.String computeAsynch(Computable job, java.lang.String codebase)
          This method submits a job for asynchronous execution.
 java.io.Serializable getResults(java.lang.String jobId)
          This method retrieves the results of a job that was executed asynchronously.
 boolean isComplete(java.lang.String jobId)
          This method check whether an asynchronous job has finished executing.
 

Method Detail

compute

public java.io.Serializable compute(Computable job)
                             throws java.rmi.RemoteException,
                                    ComputeException
This method submits a job for synchrnous execution.

Parameters:
job - the job to be executed
Returns:
the result object
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution

compute

public java.io.Serializable compute(Computable job,
                                    java.lang.String codebase)
                             throws java.rmi.RemoteException,
                                    ComputeException
This method submits a job for synchrnous execution.

Parameters:
job - the job to be executed
codebase - an alternate codebase to use for loading the Computable class
Returns:
the result object
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution

computeAsynch

public java.lang.String computeAsynch(Computable job)
                               throws java.rmi.RemoteException,
                                      ComputeException
This method submits a job for asynchronous execution. Job status can be checked with the isComplete method and the results can be retrieved by the getResults method.

Parameters:
job - the job to be executed
Returns:
the result object
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution

computeAsynch

public java.lang.String computeAsynch(Computable job,
                                      java.lang.String codebase)
                               throws java.rmi.RemoteException,
                                      ComputeException
This method submits a job for asynchronous execution. Job status can be checked with the isComplete method and the results can be retrieved by the getResults method.

Parameters:
job - the job to be executed
codebase - an alternate codebase to use for loading the Computable class
Returns:
the result object
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution

getResults

public java.io.Serializable getResults(java.lang.String jobId)
                                throws java.rmi.RemoteException,
                                       ComputeException
This method retrieves the results of a job that was executed asynchronously.

Parameters:
jobId - the id of the job
Returns:
the results object
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution

isComplete

public boolean isComplete(java.lang.String jobId)
                   throws java.rmi.RemoteException,
                          ComputeException
This method check whether an asynchronous job has finished executing.

Parameters:
jobId - the id of the job
Returns:
whether the job has finished
Throws:
java.rmi.RemoteException - if an error occurs on the server side
ComputeException - if an error occurs during job execution