org.ourgrid.mygrid.scheduler
Interface Scheduler

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
FakeScheduler, SchedulerImpl

public interface Scheduler
extends java.rmi.Remote

The Scheduler interface that should be implemented by a remote object to provide access to the Scheduler from a different Java Virtual Machine.


Method Summary
 int addJob(JobSpec newJob)
          Adds a new job to the scheduler.
 void cancelJob(int jobId)
          Cancels a job specified by jobId parameter.
 void cleanFinishedJobs()
          Clean all jobs that are not Running and will not run anymore.
 java.util.Collection<GridManagerEntry> getGumEntries(GridManagerListenerRemote newListener)
          Provides information about the gums currently in use by the scheduler
 java.util.Collection<GumSpec> getGumSpecs()
          Provides information about the gums currently in use by the scheduler
 java.util.Collection<JobEntry> jobList(JobManagerListenerRemote newListener)
          Gives access to the list of jobs on the scheduler.
 void removeGridManagerListener(GridManagerListenerRemote listener)
           
 void removeJob(int jobId)
          Remove the information about the specified job
 void removeJobManagerListener(JobManagerListenerRemote listener)
           
 void waitForJob(int jobId)
          Puts the calling thread to wait until a certain job is finished.
 

Method Detail

jobList

java.util.Collection<JobEntry> jobList(JobManagerListenerRemote newListener)
                                       throws java.rmi.RemoteException
Gives access to the list of jobs on the scheduler.

Parameters:
newListener - TODO
Returns:
The list within all the jobs on the scheduler
Throws:
java.rmi.RemoteException

waitForJob

void waitForJob(int jobId)
                throws JobNotFoundException,
                       java.rmi.RemoteException
Puts the calling thread to wait until a certain job is finished.

Parameters:
jobId - The identifier of the job the thread must wait for. This identifier is obtained when the job is added to the scheduler.
Throws:
JobNotFoundException - if there is no job with this id
java.rmi.RemoteException - if any exception occurs while contacting with this remote object.

cancelJob

void cancelJob(int jobId)
               throws JobNotFoundException,
                      java.rmi.RemoteException,
                      JobCouldNotBeCancelledException
Cancels a job specified by jobId parameter. Canceling a job implies on interrupt the running tasks and consider all the ready and running tasks as canceled tasks. Once a job is canceled, it must not be scheduled again.

Parameters:
jobId - The identification of the job to be canceled.
Throws:
JobNotFoundException - If the job specified by jobId does not exist.
java.rmi.RemoteException - If there is a communication exception during the execution of a remote method call.
JobCouldNotBeCancelledException - If asked to cancel a job that canot be cancelled anymore.

addJob

int addJob(JobSpec newJob)
           throws java.rmi.RemoteException
Adds a new job to the scheduler.

Parameters:
newJob - The JobInfo object that describes the job to be added.
Returns:
the identifier of this job for the scheduler. This identifier can be used in the waitForJob method.
Throws:
java.rmi.RemoteException - If there is a communication exception during the execution of a remote method call.

cleanFinishedJobs

void cleanFinishedJobs()
                       throws java.rmi.RemoteException
Clean all jobs that are not Running and will not run anymore.

Throws:
java.rmi.RemoteException - If there is a communication exception during the execution of a remote method call.

removeJob

void removeJob(int jobId)
               throws java.rmi.RemoteException,
                      JobCannotBeRemovedException
Remove the information about the specified job

Throws:
java.rmi.RemoteException - if there is a communication exception during the execution of a remote method call.
JobCannotBeRemovedException

getGumEntries

java.util.Collection<GridManagerEntry> getGumEntries(GridManagerListenerRemote newListener)
                                                     throws java.rmi.RemoteException
Provides information about the gums currently in use by the scheduler

Returns:
a collection with the EBGridManager entries
Throws:
java.rmi.RemoteException - if there is a communication exception during the execution of a remote method call.

getGumSpecs

java.util.Collection<GumSpec> getGumSpecs()
                                          throws java.rmi.RemoteException
Provides information about the gums currently in use by the scheduler

Returns:
a collection with the gums specifications
Throws:
java.rmi.RemoteException - if there is a communication exception during the execution of a remote method call.

removeJobManagerListener

void removeJobManagerListener(JobManagerListenerRemote listener)
                              throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

removeGridManagerListener

void removeGridManagerListener(GridManagerListenerRemote listener)
                               throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException