Package org.glassfish.api.admin
Interface JobManager
-
- All Known Implementing Classes:
JobManagerService
@Contract public interface JobManager
This is the contract for the JobManagerService The JobManager will be responsible for 1. generating unique ids for jobs 2. serving as a registry for jobs 3. creating thread pools for jobs 4.removing expired jobs- Author:
- Martin Mares, Bhakti Mehta
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
JobManager.Checkpoint
Container for checkpoint related objects
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkpoint(AdminCommandContext context, Serializable data)
Stores current command state.void
checkpoint(AdminCommand command, AdminCommandContext context)
Stores current command state.Job
get(String id)
This method is used to get a job by its idObject
getCompletedJobForId(String id)
This is a convenience method to get a completed job with an idJobInfos
getCompletedJobs(File jobs)
This will get the list of jobs from the job registry which have completedIterator<Job>
getJobs()
This method will return the list of jobs in the job registryFile
getJobsFile()
This is used to get the jobs file for a jobString
getNewId()
This method is used to generate a unique id for a managed job<T extends Serializable>
TloadCheckpointData(String jobId)
Load checkpoint related data.Object
purgeCompletedJobForId(String id)
This is used to purge a completed job whose id is providedvoid
purgeJob(String id)
This will purge the job associated with the id from the registryvoid
registerJob(Job instance)
This method will register the job in the job registry
-
-
-
Method Detail
-
getNewId
String getNewId()
This method is used to generate a unique id for a managed job- Returns:
- returns a new id for the job
-
registerJob
void registerJob(Job instance) throws IllegalArgumentException
This method will register the job in the job registry- Parameters:
instance
- job to be registered- Throws:
IllegalArgumentException
-
getJobs
Iterator<Job> getJobs()
This method will return the list of jobs in the job registry- Returns:
- list of jobs
-
get
Job get(String id)
This method is used to get a job by its id- Parameters:
id
- The id to look up the job in the job registry- Returns:
- the Job
-
purgeJob
void purgeJob(String id)
This will purge the job associated with the id from the registry- Parameters:
id
- the id of the Job which needs to be purged
-
getCompletedJobs
JobInfos getCompletedJobs(File jobs)
This will get the list of jobs from the job registry which have completed- Returns:
- the details of all completed jobs using JobInfos
-
getCompletedJobForId
Object getCompletedJobForId(String id)
This is a convenience method to get a completed job with an id- Parameters:
id
- the completed Job whose id needs to be looked up- Returns:
- the completed Job
-
purgeCompletedJobForId
Object purgeCompletedJobForId(String id)
This is used to purge a completed job whose id is provided- Parameters:
id
- the id of the Job which needs to be purged- Returns:
- the new list of completed jobs
-
getJobsFile
File getJobsFile()
This is used to get the jobs file for a job- Returns:
- the location of the job file
-
checkpoint
void checkpoint(AdminCommand command, AdminCommandContext context) throws IOException
Stores current command state.- Throws:
IOException
-
checkpoint
void checkpoint(AdminCommandContext context, Serializable data) throws IOException
Stores current command state.- Throws:
IOException
-
loadCheckpointData
<T extends Serializable> T loadCheckpointData(String jobId) throws IOException, ClassNotFoundException
Load checkpoint related data.- Throws:
IOException
ClassNotFoundException
-
-