Package org.glassfish.api.admin
Interface JobManager
@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
Modifier and TypeInterfaceDescriptionstatic class
Container for checkpoint related objects -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkpoint
(AdminCommandContext context, Serializable data) Stores current command state.void
checkpoint
(AdminCommand command, AdminCommandContext context) Stores current command state.This method is used to get a job by its idThis is a convenience method to get a completed job with an idgetCompletedJobs
(File jobs) This will get the list of jobs from the job registry which have completedgetJobs()
This method will return the list of jobs in the job registryThis is used to get the jobs file for a jobgetNewId()
This method is used to generate a unique id for a managed job<T extends Serializable>
TloadCheckpointData
(String jobId) Load checkpoint related data.This is used to purge a completed job whose id is providedvoid
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 Details
-
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
This method will register the job in the job registry- Parameters:
instance
- job to be registered- Throws:
IllegalArgumentException
-
getJobs
This method will return the list of jobs in the job registry- Returns:
- list of jobs
-
get
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
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
This will get the list of jobs from the job registry which have completed- Returns:
- the details of all completed jobs using JobInfos
-
getCompletedJobForId
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
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
Stores current command state.- Throws:
IOException
-
checkpoint
Stores current command state.- Throws:
IOException
-
loadCheckpointData
<T extends Serializable> T loadCheckpointData(String jobId) throws IOException, ClassNotFoundException Load checkpoint related data.- Throws:
IOException
ClassNotFoundException
-