Package org.quartz.jobs
Class SimpleJobFactory
java.lang.Object
org.quartz.jobs.SimpleJobFactory
- All Implemented Interfaces:
JobFactory
The default JobFactory used by Quartz - simply calls
newInstance()
on the job class.- Author:
- jhouse
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionnewJob
(TriggerFiredBundle bundle, Scheduler Scheduler) Called by the scheduler at the time of the trigger firing, in order to produce aJob
instance on which to call execute.
-
Constructor Details
-
SimpleJobFactory
public SimpleJobFactory()
-
-
Method Details
-
newJob
Description copied from interface:JobFactory
Called by the scheduler at the time of the trigger firing, in order to produce aJob
instance on which to call execute.It should be extremely rare for this method to throw an exception - basically only the the case where there is no way at all to instantiate and prepare the Job for execution. When the exception is thrown, the Scheduler will move all triggers associated with the Job into the
Trigger.STATE_ERROR
state, which will require human intervention (e.g. an application restart after fixing whatever configuration problem led to the issue wih instantiating the Job.- Specified by:
newJob
in interfaceJobFactory
- Parameters:
bundle
- The TriggerFiredBundle from which theJobDetail
and other info relating to the trigger firing can be obtained.Scheduler
- a handle to the scheduler that is about to execute the job.- Returns:
- the newly instantiated Job
- Throws:
SchedulerException
- if there is a problem instantiating the Job.
-