Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.scheduling.quartz
Class AdaptableJobFactory

    java.lang.Object
      org.springframework.scheduling.quartz.AdaptableJobFactory

All Implemented Interfaces:
  org.quartz.spi.JobFactory

Direct Known Subclasses:
  SpringBeanJobFactory

    public class AdaptableJobFactory

extends java.lang.Object
implements org.quartz.spi.JobFactory

JobFactory implementation that supports `Runnable` objects as well as standard Quartz `Job` instances.

Compatible with Quartz 1.5+ as well as Quartz 2.0/2.1, as of Spring 3.1.

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

Constructor Summary
`AdaptableJobFactory()`

Method Summary
`protected org.quartz.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.
`org.quartz.Job` | `newJob(org.quartz.spi.TriggerFiredBundle bundle)` Quartz 1.x version of newJob: contains actual implementation code.
`org.quartz.Job` | `newJob(org.quartz.spi.TriggerFiredBundle bundle, org.quartz.Scheduler scheduler)` Quartz 2.0 version of newJob: simply delegates to old newJob variant.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AdaptableJobFactory

    public AdaptableJobFactory()

Method Detail

### newJob

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

  Quartz 2.0 version of newJob: simply delegates to old newJob variant.

  Throws:
    `org.quartz.SchedulerException`
  See Also:
    `newJob(org.quartz.spi.TriggerFiredBundle)`

### newJob

    public org.quartz.Job newJob(org.quartz.spi.TriggerFiredBundle bundle)
                          throws org.quartz.SchedulerException

  Quartz 1.x version of newJob: contains actual implementation code.

  Specified by:
    `newJob` in interface `org.quartz.spi.JobFactory`
  Throws:
    `org.quartz.SchedulerException`

### createJobInstance

    protected java.lang.Object createJobInstance(org.quartz.spi.TriggerFiredBundle bundle)
                                          throws java.lang.Exception

  Create an instance of the specified job class.

  Can be overridden to post-process the job instance.

  Parameters:
    `bundle` - the TriggerFiredBundle from which the JobDetail and other info relating to the trigger firing can be obtained
  Returns:
    the job instance
  Throws:
    `java.lang.Exception` - if job instantiation failed

### adaptJob

    protected org.quartz.Job adaptJob(java.lang.Object jobObject)
                               throws java.lang.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` - the original instance of the specified job class
  Returns:
    the adapted Quartz Job instance
  Throws:
    `java.lang.Exception` - if the given job could not be adapted
  See Also:
    `DelegatingJob`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD