org.ourgrid.mygrid.scheduler.jobmanager
Interface JobManager

All Known Implementing Classes:
AbstractJobManager, EBJobManager, FakeJobManager

public interface JobManager


Method Summary
 void addJob(int jobId, JobSpec jobSpec)
          Adds a new Job.
 void addJobInterested(JobInterested jobInterested)
           
 void addNewListener(JobManagerListenerRemote newListener)
           
 void cleanFinishedJobs()
          Clean the list of terminated jobs
 java.util.Collection<JobEntry> clonedJobList()
           
 ReplicaEntry createNewReplica(TaskEntry task)
           
 JobEntry getJobById(int jobId)
           
 ExecutionStatus getJobState(int jobID)
           
 java.util.Collection<JobEntry> jobList()
          Returns the Job list.
 void removeJob(int jobId)
          Remove the information about the specified job
 void removeListener(JobManagerListenerRemote listener)
           
 void replicaAborted(ReplicaExecutorResult result)
          Sets the Replica state to aborted.
 void replicaCanceled(ReplicaExecutorResult result)
          Sets the Replica state to canceled.
 void replicaFailed(ReplicaExecutorResult result)
          Sets the Replica state to failed.
 void replicaFinished(ReplicaExecutorResult result)
          Sets the Replica state to finished.
 void replicaRunning(ReplicaEntry replica, GumID gumID)
           
 void setCanceled(int jobId)
          Sets the given job as canceled.
 void setMaxFails(java.lang.String string)
           
 void setMaxReplicas(java.lang.String string)
           
 void shutdown()
           
 

Method Detail

addJob

void addJob(int jobId,
            JobSpec jobSpec)
Adds a new Job.

Parameters:
jobSpec - The job specification.

replicaFinished

void replicaFinished(ReplicaExecutorResult result)
Sets the Replica state to finished. It also notifies JobInteresteds case it is necessary.

Parameters:
result - The ReplicaExecutorResult.

replicaFailed

void replicaFailed(ReplicaExecutorResult result)
Sets the Replica state to failed. It also notifies JobInteresteds case it is necessary.

Parameters:
result - The ReplicaExecutorResult.

replicaAborted

void replicaAborted(ReplicaExecutorResult result)
Sets the Replica state to aborted. It also notifies JobInteresteds case it is necessary.

Parameters:
result - The ReplicaExecutorResult.

replicaCanceled

void replicaCanceled(ReplicaExecutorResult result)
Sets the Replica state to canceled. It also notifies JobInteresteds case it is necessary.

Parameters:
result - The ReplicaExecutorResult.

setCanceled

void setCanceled(int jobId)
                 throws JobNotFoundException,
                        JobCouldNotBeCancelledException
Sets the given job as canceled.

Parameters:
jobId - The job identification
Throws:
JobNotFoundException - when the job was not found
JobCouldNotBeCancelledException - when the job could not be canceled

cleanFinishedJobs

void cleanFinishedJobs()
Clean the list of terminated jobs


removeJob

void removeJob(int jobId)
               throws JobCannotBeRemovedException
Remove the information about the specified job

Parameters:
jobId -
Throws:
JobCannotBeRemovedException

jobList

java.util.Collection<JobEntry> jobList()
Returns the Job list.

Returns:
The Job list.

clonedJobList

java.util.Collection<JobEntry> clonedJobList()

getJobById

JobEntry getJobById(int jobId)

createNewReplica

ReplicaEntry createNewReplica(TaskEntry task)

getJobState

ExecutionStatus getJobState(int jobID)

addJobInterested

void addJobInterested(JobInterested jobInterested)

setMaxReplicas

void setMaxReplicas(java.lang.String string)
                    throws ConfigException
Throws:
ConfigException

setMaxFails

void setMaxFails(java.lang.String string)
                 throws ConfigException
Throws:
ConfigException

addNewListener

void addNewListener(JobManagerListenerRemote newListener)

replicaRunning

void replicaRunning(ReplicaEntry replica,
                    GumID gumID)

removeListener

void removeListener(JobManagerListenerRemote listener)

shutdown

void shutdown()