Package org.quartz.spi
Interface JobFactory
-
- All Known Implementing Classes:
PropertySettingJobFactory,SimpleJobFactory
public interface JobFactoryA JobFactory is responsible for producing instances of
Jobclasses.This interface may be of use to those wishing to have their application produce
Jobinstances via some special mechanism, such as to give the opportunity for dependency injection.- Author:
- James House
- See Also:
Scheduler.setJobFactory(JobFactory),SimpleJobFactory,PropertySettingJobFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description JobnewJob(TriggerFiredBundle bundle, Scheduler scheduler)Called by the scheduler at the time of the trigger firing, in order to produce aJobinstance on which to call execute.
-
-
-
Method Detail
-
newJob
Job newJob(TriggerFiredBundle bundle, Scheduler scheduler) throws SchedulerException
Called by the scheduler at the time of the trigger firing, in order to produce aJobinstance on which to call execute.It should be extremely rare for this method to throw an exception - basically only 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_ERRORstate, which will require human intervention (e.g. an application restart after fixing whatever configuration problem led to the issue with instantiating the Job.- Parameters:
bundle- The TriggerFiredBundle from which theJobDetailand 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.
-
-