Save This Page
Home » spring-framework-2.5.4 » org.springframework » scheduling » quartz » [javadoc | source]
org.springframework.scheduling.quartz
public class: JobDetailBean [javadoc | source]
java.lang.Object
   org.quartz.JobDetail
      org.springframework.scheduling.quartz.JobDetailBean

All Implemented Interfaces:
    ApplicationContextAware, BeanNameAware, InitializingBean

Convenience subclass of Quartz' JobDetail class that eases bean-style usage.

JobDetail itself is already a JavaBean but lacks sensible defaults. This class uses the Spring bean name as job name, and the Quartz default group ("DEFAULT") as job group if not specified.

Method from org.springframework.scheduling.quartz.JobDetailBean Summary:
afterPropertiesSet,   getJobClass,   setApplicationContext,   setApplicationContextJobDataKey,   setBeanName,   setJobClass,   setJobDataAsMap,   setJobListenerNames
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.scheduling.quartz.JobDetailBean Detail:
 public  void afterPropertiesSet() 
 public Class getJobClass() 
    Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
 public  void setApplicationContext(ApplicationContext applicationContext) 
 public  void setApplicationContextJobDataKey(String applicationContextJobDataKey) 
    Set the key of an ApplicationContext reference to expose in the JobDataMap, for example "applicationContext". Default is none. Only applicable when running in a Spring ApplicationContext.

    In case of a QuartzJobBean, the reference will be applied to the Job instance as bean property. An "applicationContext" attribute will correspond to a "setApplicationContext" method in that scenario.

    Note that BeanFactory callback interfaces like ApplicationContextAware are not automatically applied to Quartz Job instances, because Quartz itself is responsible for the lifecycle of its Jobs.

    Note: When using persistent job stores where JobDetail contents will be kept in the database, do not put an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

 public  void setBeanName(String beanName) 
 public  void setJobClass(Class jobClass) 
    Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface.
 public  void setJobDataAsMap(Map jobDataAsMap) 
    Register objects in the JobDataMap via a given Map.

    These objects will be available to this Job only, in contrast to objects in the SchedulerContext.

    Note: When using persistent Jobs whose JobDetail will be kept in the database, do not put Spring-managed beans or an ApplicationContext reference into the JobDataMap but rather into the SchedulerContext.

 public  void setJobListenerNames(String[] names) 
    Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler.

    A JobListener name always refers to the name returned by the JobListener implementation.