org.ourgrid.mygrid.ui.test
Class FakeScheduler

java.lang.Object
  extended by org.ourgrid.mygrid.ui.test.FakeScheduler
All Implemented Interfaces:
java.rmi.Remote, Scheduler

public class FakeScheduler
extends java.lang.Object
implements Scheduler


Nested Class Summary
 class FakeScheduler.FakeJob
           
 class FakeScheduler.FakeReplica
           
 class FakeScheduler.FakeTask
           
 
Constructor Summary
FakeScheduler()
           
 
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 setJobList(java.util.Map<java.lang.Integer,JobEntry> c)
           
 void waitForJob(int jobId)
          Puts the calling thread to wait until a certain job is finished.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeScheduler

public FakeScheduler()
Method Detail

jobList

public java.util.Collection<JobEntry> jobList(JobManagerListenerRemote newListener)
                                       throws java.rmi.RemoteException
Description copied from interface: Scheduler
Gives access to the list of jobs on the scheduler.

Specified by:
jobList in interface Scheduler
Parameters:
newListener - TODO
Returns:
The list within all the jobs on the scheduler
Throws:
java.rmi.RemoteException

waitForJob

public void waitForJob(int jobId)
                throws JobNotFoundException,
                       java.rmi.RemoteException
Description copied from interface: Scheduler
Puts the calling thread to wait until a certain job is finished.

Specified by:
waitForJob in interface Scheduler
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

public void cancelJob(int jobId)
               throws JobNotFoundException,
                      java.rmi.RemoteException
Description copied from interface: Scheduler
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.

Specified by:
cancelJob in interface Scheduler
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.

addJob

public int addJob(JobSpec newJob)
           throws java.rmi.RemoteException
Description copied from interface: Scheduler
Adds a new job to the scheduler.

Specified by:
addJob in interface 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.

setJobList

public void setJobList(java.util.Map<java.lang.Integer,JobEntry> c)

cleanFinishedJobs

public void cleanFinishedJobs()
                       throws java.rmi.RemoteException
Description copied from interface: Scheduler
Clean all jobs that are not Running and will not run anymore.

Specified by:
cleanFinishedJobs in interface Scheduler
Throws:
java.rmi.RemoteException - If there is a communication exception during the execution of a remote method call.

removeJob

public void removeJob(int jobId)
               throws java.rmi.RemoteException
Description copied from interface: Scheduler
Remove the information about the specified job

Specified by:
removeJob in interface Scheduler
Throws:
java.rmi.RemoteException - if there is a communication exception during the execution of a remote method call.

getGumEntries

public java.util.Collection<GridManagerEntry> getGumEntries(GridManagerListenerRemote newListener)
                                                     throws java.rmi.RemoteException
Description copied from interface: Scheduler
Provides information about the gums currently in use by the scheduler

Specified by:
getGumEntries in interface 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

public java.util.Collection<GumSpec> getGumSpecs()
                                          throws java.rmi.RemoteException
Description copied from interface: Scheduler
Provides information about the gums currently in use by the scheduler

Specified by:
getGumSpecs in interface 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

public void removeJobManagerListener(JobManagerListenerRemote listener)
Specified by:
removeJobManagerListener in interface Scheduler

removeGridManagerListener

public void removeGridManagerListener(GridManagerListenerRemote listener)
Specified by:
removeGridManagerListener in interface Scheduler