Top Description Constructors Methods
org.springframework.scheduling.quartz

public Class AdaptableJobFactory

extends Object
implements org.quartz.spi.JobFactory
Class Inheritance
Known Direct Subclasses
org.springframework.scheduling.quartz.SpringBeanJobFactory
Imports
org.quartz.Job, org.quartz.Scheduler, org.quartz.SchedulerException, org.quartz.spi.JobFactory, org.quartz.spi.TriggerFiredBundle, org.springframework.util.ReflectionUtils

JobFactory implementation that supports java.lang.Runnable objects as well as standard Quartz org.quartz.Job instances.

Compatible with Quartz 2.1.4 and higher, as of Spring 4.1.

Author
Juergen Hoeller
Since
2.0
See Also
DelegatingJob, adaptJob(Object)

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected org.quartz.Job

Returns:

the adapted Quartz Job instance
adaptJob
(Object
the original instance of the specified job class
jobObject
)

Adapt the given job object to the Quartz Job interface.

protected Object

Returns:

the job instance
createJobInstance
(org.quartz.spi.TriggerFiredBundle
the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained
bundle
)

Create an instance of the specified job class.

public org.quartz.Job
newJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

AdaptableJobFactoryback to summary
public AdaptableJobFactory()

Method Detail

adaptJobback to summary
protected org.quartz.Job adaptJob(Object jobObject) throws Exception

Adapt the given job object to the Quartz Job interface.

The default implementation supports straight Quartz Jobs as well as Runnables, which get wrapped in a DelegatingJob.

Parameters
jobObject:Object

the original instance of the specified job class

Returns:org.quartz.Job

the adapted Quartz Job instance

Exceptions
Exception:
if the given job could not be adapted
See Also
DelegatingJob
createJobInstanceback to summary
protected Object createJobInstance(org.quartz.spi.TriggerFiredBundle bundle) throws Exception

Create an instance of the specified job class.

Can be overridden to post-process the job instance.

Parameters
bundle:org.quartz.spi.TriggerFiredBundle

the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained

Returns:Object

the job instance

Exceptions
Exception:
if job instantiation failed
newJobback to summary
public org.quartz.Job newJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler) throws org.quartz.SchedulerException
Annotations
@Override