public interface ExecutionManager
Lets managing the execution of a set of jobs.
It is used by a job list to decide whether a given job can be executed or whether it must be put in a queue.
Besides the job must notify its manager when it is asked to start (execute(UWSJob)
)
and to end (remove(UWSJob)
).
Modifier and Type | Method and Description |
---|---|
ExecutionPhase |
execute(UWSJob job)
Lets deciding whether the given job can start immediately or whether it must be put in the queue.
|
int |
getNbQueuedJobs()
Gets the total number of queued jobs.
|
int |
getNbRunningJobs()
Gets the total number of running jobs.
|
java.util.Iterator<UWSJob> |
getQueuedJobs()
Gets the list of queued jobs.
|
java.util.Iterator<UWSJob> |
getRunningJobs()
Gets the list of running jobs.
|
void |
refresh()
Refreshes the lists of running and queued jobs.
|
void |
remove(UWSJob jobToRemove)
Removes the job from this manager whatever is its current execution phase.
|
void |
stopAll()
Stop all running jobs.
|
java.util.Iterator<UWSJob> getRunningJobs()
int getNbRunningJobs()
java.util.Iterator<UWSJob> getQueuedJobs()
int getNbQueuedJobs()
void refresh()
Refreshes the lists of running and queued jobs.
Note: If any error occurs while refreshing this manager, it SHOULD be logged using the service logger.
ExecutionPhase execute(UWSJob job)
Lets deciding whether the given job can start immediately or whether it must be put in the queue.
Note: If any error occurs while executing the given job, it SHOULD be logged using the service logger.
job
- The job to execute.UWSJob.start(boolean)
,
UWSJob.setPhase(ExecutionPhase)
void remove(UWSJob jobToRemove)
Removes the job from this manager whatever is its current execution phase.
Note: If any error occurs while removing a job from this manager, it SHOULD be logged using the service logger.
jobToRemove
- The job to remove.void stopAll()
Stop all running jobs. No more job, even the queued ones, must be executed after a call to this function. All stopped or aborted queued jobs should be set forcedly back to the PENDING status.
Note:
A call to execute(UWSJob)
would re-activate this manager. However jobs stopped or
aborted using this function might not be starting again. These behaviors at implementation-dependent.