|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.JobDetail org.springframework.scheduling.quartz.JobDetailBean
public class JobDetailBean
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.
JobDetail.setName(java.lang.String)
,
JobDetail.setGroup(java.lang.String)
,
BeanNameAware
,
Scheduler.DEFAULT_GROUP
,
Serialized FormConstructor Summary | |
---|---|
JobDetailBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
Class |
getJobClass()
Overridden to support any job class, to allow a custom JobFactory to adapt the given job class to the Quartz Job interface. |
void |
setApplicationContext(ApplicationContext applicationContext)
Set the ApplicationContext that this object runs in. |
void |
setApplicationContextJobDataKey(String applicationContextJobDataKey)
Set the key of an ApplicationContext reference to expose in the JobDataMap, for example "applicationContext". |
void |
setBeanName(String beanName)
Set the name of the bean in the bean factory that created this bean. |
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. |
void |
setJobDataAsMap(Map jobDataAsMap)
Register objects in the JobDataMap via a given Map. |
void |
setJobListenerNames(String[] names)
Set a list of JobListener names for this job, referring to non-global JobListeners registered with the Scheduler. |
Methods inherited from class org.quartz.JobDetail |
---|
addJobListener, clone, getDescription, getFullName, getGroup, getJobDataMap, getJobListenerNames, getKey, getName, isDurable, isStateful, isVolatile, removeJobListener, requestsRecovery, setDescription, setDurability, setGroup, setJobDataMap, setName, setRequestsRecovery, setVolatility, toString, validate |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JobDetailBean()
Method Detail |
---|
public void setJobClass(Class jobClass)
setJobClass
in class JobDetail
public Class getJobClass()
getJobClass
in class JobDetail
public void setJobDataAsMap(Map jobDataAsMap)
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.
jobDataAsMap
- Map with String keys and any objects as values
(for example Spring-managed beans)SchedulerFactoryBean.setSchedulerContextAsMap(java.util.Map)
public void setJobListenerNames(String[] names)
A JobListener name always refers to the name returned by the JobListener implementation.
public void setBeanName(String beanName)
BeanNameAware
Invoked after population of normal bean properties but before an
init callback such as InitializingBean.afterPropertiesSet()
or a custom init-method.
setBeanName
in interface BeanNameAware
beanName
- the name of the bean in the factory.
Note that this name is the actual bean name used in the factory, which may
differ from the originally specified name: in particular for inner bean
names, the actual bean name might have been made unique through appending
"#..." suffixes. Use the BeanFactoryUtils.originalBeanName(String)
method to extract the original bean name (without suffix), if desired.public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface ApplicationContextAware
applicationContext
- the ApplicationContext object to be used by this objectBeanInitializationException
public void setApplicationContextJobDataKey(String applicationContextJobDataKey)
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 afterPropertiesSet()
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |