java.lang.Object | ||
↳ | CronTrigger | |
↳ | org.springframework.scheduling.quartz.CronTriggerBean |
Convenience subclass of Quartz's org.quartz.CronTrigger class, making bean-style usage easier.
CronTrigger itself is already a JavaBean but lacks sensible defaults. This class uses the Spring bean name as job name, the Quartz default group ("DEFAULT") as job group, the current time as start time, and indefinite repetition, if not specified.
This class will also register the trigger with the job name and group of
a given org.quartz.JobDetail. This allows SchedulerFactoryBean
to automatically register a trigger for the corresponding JobDetail,
instead of registering the JobDetail separately.
NOTE: This convenience subclass does not work with trigger persistence in Quartz 1.6, due to a change in Quartz's trigger handling. Use Quartz 1.5 if you rely on trigger persistence based on this class, or the standard Quartz org.quartz.CronTrigger class instead.
setJobDetail(JobDetail)
setTriggers(Trigger[])
setJobDetails(JobDetail[])
SimpleTriggerBean
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
| |||||||||||
Return the JobDetail that this Trigger is associated with.
| |||||||||||
Set the name of the bean in the bean factory that created this bean.
| |||||||||||
Register objects in the JobDataMap via a given Map.
| |||||||||||
Set the JobDetail that this trigger should be associated with.
| |||||||||||
Set the misfire instruction via the name of the corresponding
constant in the org.quartz.CronTrigger class.
| |||||||||||
Set the start delay in milliseconds.
| |||||||||||
Set a list of TriggerListener names for this job, referring to
non-global TriggerListeners registered with the Scheduler.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.beans.factory.BeanNameAware
| |||||||||||
From interface
org.springframework.beans.factory.InitializingBean
| |||||||||||
From interface
org.springframework.scheduling.quartz.JobDetailAwareTrigger
|
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
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.
Exception |
---|
Return the JobDetail that this Trigger is associated with.
null
if none
Set the name of the bean in the bean factory that created this bean.
Invoked after population of normal bean properties but before an
init callback such as afterPropertiesSet()
or a custom init-method.
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. |
---|
Register objects in the JobDataMap via a given Map.
These objects will be available to this Trigger only, in contrast to objects in the JobDetail's data map.
jobDataAsMap | Map with String keys and any objects as values (for example Spring-managed beans) |
---|
Set the JobDetail that this trigger should be associated with.
This is typically used with a bean reference if the JobDetail is a Spring-managed bean. Alternatively, the trigger can also be associated with a job by name and group.
Set the misfire instruction via the name of the corresponding
constant in the org.quartz.CronTrigger class.
Default is MISFIRE_INSTRUCTION_SMART_POLICY
.
Set the start delay in milliseconds.
The start delay is added to the current system time (when the bean starts) to control the #setStartTime start time of the trigger.
If the start delay is non-zero it will always take precedence over start time.
startDelay | the start delay, in milliseconds. |
---|
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler.
A TriggerListener name always refers to the name returned by the TriggerListener implementation.
setTriggerListeners(TriggerListener[])