Package com.swiftmq.swiftlet.scheduler
Interface JobFactory
-
- All Known Implementing Classes:
BackupJobFactory
,DeleteDurableJobFactory
,MessageSenderJobFactory
,MultiQueuePurgerJobFactory
,QueueCleanupDLQJobFactory
,QueueCleanupJobFactory
,QueueMoverJobFactory
,QueuePurgerJobFactory
,QueueResetJobFactory
,RoutingConnectorJobFactory
,ShrinkJobFactory
,StreamsJobFactory
public interface JobFactory
A JobFactory is registered at a JobGroup and creates Jobs. The name of the factory should be the name of the Job, created from this factory. For example, a factory creating 'Queue Mover' jobs returns 'Queue Mover' as its name.
Before a Job is obtained from the factory with "getJobInstance", the job parameters are retrieved and verified. If that was ok, the Job is obtained from the factory via the "getJobInstance" method. After the Job has been finished, the method "finished" is called with the Job instance and eventually a JobException, thrown by the Job.
Due to this check-out (getJobInstance) and check-in (finished) behavior, a JobFactory can be implemented as a pool of Jobs with pre-created Job instances etc.
A JobFactory is accessed by a single thread at a time, so there is no need for synchronization.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2003, All Rights Reserved
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
finished(Job job, JobException exception)
Marks a Job instance as finished.java.lang.String
getDescription()
Returns a short description of the JobFactory, e.g.Job
getJobInstance()
Returns a Job instance.JobParameter
getJobParameter(java.lang.String name)
Returns a JobParameter with the given parameter name.java.util.Map
getJobParameters()
Returns a Map of JobParameters, keyed by the parameter name or null if no parameter is defined.java.lang.String
getName()
Returns the name of the JobFactory, e.g.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Returns the name of the JobFactory, e.g. 'Queue Mover'- Returns:
- Name
-
getDescription
java.lang.String getDescription()
Returns a short description of the JobFactory, e.g. 'Moves the content of a Queue'- Returns:
- description
-
getJobParameters
java.util.Map getJobParameters()
Returns a Map of JobParameters, keyed by the parameter name or null if no parameter is defined.- Returns:
- Map of JobParameters
-
getJobParameter
JobParameter getJobParameter(java.lang.String name)
Returns a JobParameter with the given parameter name.- Parameters:
name
- Parameter name- Returns:
- JobParameter or null
-
getJobInstance
Job getJobInstance()
Returns a Job instance. This is equal to a check-out of a pool.- Returns:
- Job
-
finished
void finished(Job job, JobException exception)
Marks a Job instance as finished. Called after the Job has been terminated. This is equal to a check-in into a pool.- Parameters:
job
- Job instanceexception
- JobException thrown by the Job instance
-
-