public class AdaptableJobFactory extends java.lang.Object implements org.quartz.spi.JobFactory
Runnable
objects as well as standard Quartz Job instances.
Compatible with Quartz 1.8 as well as Quartz 2.0/2.1, as of Spring 4.0.
DelegatingJob,
adaptJob(Object)| Constructor and Description |
|---|
AdaptableJobFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected Job |
adaptJob(java.lang.Object jobObject)
Adapt the given job object to the Quartz Job interface.
|
protected java.lang.Object |
createJobInstance(org.quartz.spi.TriggerFiredBundle bundle)
Create an instance of the specified job class.
|
Job |
newJob(org.quartz.spi.TriggerFiredBundle bundle)
Quartz 1.x version of newJob: contains actual implementation code.
|
Job |
newJob(org.quartz.spi.TriggerFiredBundle bundle,
Scheduler scheduler)
Quartz 2.0 version of newJob: simply delegates to old newJob variant.
|
public Job newJob(org.quartz.spi.TriggerFiredBundle bundle, Scheduler scheduler) throws SchedulerException
SchedulerExceptionnewJob(org.quartz.spi.TriggerFiredBundle)public Job newJob(org.quartz.spi.TriggerFiredBundle bundle) throws SchedulerException
newJob in interface org.quartz.spi.JobFactorySchedulerExceptionprotected java.lang.Object createJobInstance(org.quartz.spi.TriggerFiredBundle bundle) throws java.lang.Exception
Can be overridden to post-process the job instance.
bundle - the TriggerFiredBundle from which the JobDetail
and other info relating to the trigger firing can be obtainedjava.lang.Exception - if job instantiation failedprotected Job adaptJob(java.lang.Object jobObject) throws java.lang.Exception
The default implementation supports straight Quartz Jobs as well as Runnables, which get wrapped in a DelegatingJob.
jobObject - the original instance of the specified job classjava.lang.Exception - if the given job could not be adaptedDelegatingJob