|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTrigger org.springframework.scheduling.quartz.SimpleTriggerBean
public class SimpleTriggerBean
Convenience subclass of Quartz's org.quartz.SimpleTrigger
class,
making bean-style usage easier.
SimpleTrigger 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.SimpleTrigger
class instead.
#setName
,
#setGroup
,
#setStartTime
,
#setJobName
,
#setJobGroup
,
setJobDetail(JobDetail)
,
SchedulerAccessor.setTriggers(Trigger[])
,
SchedulerAccessor.setJobDetails(JobDetail[])
,
CronTriggerBean
Field Summary | |
---|---|
private java.lang.String |
beanName
|
private static Constants |
constants
Constants for the SimpleTrigger class |
private JobDetail |
jobDetail
|
private long |
startDelay
|
Constructor Summary | |
---|---|
SimpleTriggerBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
JobDetail |
getJobDetail()
Return the JobDetail that this Trigger is associated with. |
void |
setBeanName(java.lang.String beanName)
Set the name of the bean in the bean factory that created this bean. |
void |
setJobDataAsMap(java.util.Map jobDataAsMap)
Register objects in the JobDataMap via a given Map. |
void |
setJobDetail(JobDetail jobDetail)
Set the JobDetail that this trigger should be associated with. |
void |
setMisfireInstructionName(java.lang.String constantName)
Set the misfire instruction via the name of the corresponding constant in the org.quartz.SimpleTrigger class. |
void |
setStartDelay(long startDelay)
Set the delay before starting the job for the first time. |
void |
setTriggerListenerNames(java.lang.String[] names)
Set a list of TriggerListener names for this job, referring to non-global TriggerListeners registered with the Scheduler. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Constants constants
private long startDelay
private JobDetail jobDetail
private java.lang.String beanName
Constructor Detail |
---|
public SimpleTriggerBean()
Method Detail |
---|
public void setJobDataAsMap(java.util.Map jobDataAsMap)
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)JobDetailBean.setJobDataAsMap(java.util.Map)
public void setMisfireInstructionName(java.lang.String constantName)
org.quartz.SimpleTrigger
class.
Default is MISFIRE_INSTRUCTION_SMART_POLICY
.
org.quartz.SimpleTrigger#MISFIRE_INSTRUCTION_FIRE_NOW
,
org.quartz.SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
,
org.quartz.SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
,
org.quartz.SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
,
org.quartz.SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
,
org.quartz.Trigger#MISFIRE_INSTRUCTION_SMART_POLICY
public void setTriggerListenerNames(java.lang.String[] names)
A TriggerListener name always refers to the name returned by the TriggerListener implementation.
SchedulerAccessor.setTriggerListeners(TriggerListener[])
,
org.quartz.TriggerListener#getName
public void setStartDelay(long startDelay)
This delay will just be applied if no custom start time was specified. However, in typical usage within a Spring context, the start time will be the container startup time anyway. Specifying a relative delay is appropriate in that case.
#setStartTime
public void setJobDetail(JobDetail jobDetail)
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.
#setJobName
,
#setJobGroup
public JobDetail getJobDetail()
JobDetailAwareTrigger
getJobDetail
in interface JobDetailAwareTrigger
null
if nonepublic void setBeanName(java.lang.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 afterPropertiesSet() throws java.text.ParseException
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
java.text.ParseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |