|
spring-context-support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.quartz.Trigger
org.quartz.CronTrigger
org.springframework.scheduling.quartz.CronTriggerBean
public class CronTriggerBean
Convenience subclass of Quartz's 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 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 against Quartz 2.0.
Use Quartz 2.0's native JobDetailImpl
class or the new Quartz 2.0
builder API instead. Alternatively, switch to Spring's CronTriggerFactoryBean
which largely is a drop-in replacement for this class and its properties and
consistently works against Quartz 1.x as well as Quartz 2.0/2.1.
Trigger.setName(java.lang.String)
,
Trigger.setGroup(java.lang.String)
,
CronTrigger.setStartTime(java.util.Date)
,
Trigger.setJobName(java.lang.String)
,
Trigger.setJobGroup(java.lang.String)
,
setJobDetail(org.quartz.JobDetail)
,
SchedulerAccessor.setTriggers(org.quartz.Trigger[])
,
SchedulerAccessor.setJobDetails(org.quartz.JobDetail[])
,
SimpleTriggerBean
,
Serialized FormField Summary |
---|
Fields inherited from class org.quartz.CronTrigger |
---|
MISFIRE_INSTRUCTION_DO_NOTHING, MISFIRE_INSTRUCTION_FIRE_ONCE_NOW |
Fields inherited from class org.quartz.Trigger |
---|
DEFAULT_PRIORITY, INSTRUCTION_DELETE_TRIGGER, INSTRUCTION_NOOP, INSTRUCTION_RE_EXECUTE_JOB, INSTRUCTION_SET_ALL_JOB_TRIGGERS_COMPLETE, INSTRUCTION_SET_ALL_JOB_TRIGGERS_ERROR, INSTRUCTION_SET_TRIGGER_COMPLETE, INSTRUCTION_SET_TRIGGER_ERROR, MISFIRE_INSTRUCTION_SMART_POLICY, STATE_BLOCKED, STATE_COMPLETE, STATE_ERROR, STATE_NONE, STATE_NORMAL, STATE_PAUSED |
Fields inherited from interface org.springframework.scheduling.quartz.JobDetailAwareTrigger |
---|
JOB_DETAIL_KEY |
Constructor Summary | |
---|---|
CronTriggerBean()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
|
org.quartz.JobDetail |
getJobDetail()
Return the JobDetail that this Trigger is associated with. |
void |
setBeanName(java.lang.String beanName)
|
void |
setJobDataAsMap(java.util.Map<java.lang.String,?> jobDataAsMap)
Register objects in the JobDataMap via a given Map. |
void |
setJobDetail(org.quartz.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 CronTrigger class. |
void |
setStartDelay(long startDelay)
Set the start delay in milliseconds. |
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 org.quartz.CronTrigger |
---|
clone, computeFirstFireTime, executionComplete, getCronExpression, getEndTime, getExpressionSummary, getFinalFireTime, getFireTimeAfter, getNextFireTime, getPreviousFireTime, getStartTime, getTimeAfter, getTimeBefore, getTimeZone, hasAdditionalProperties, main, mayFireAgain, setCronExpression, setCronExpression, setEndTime, setNextFireTime, setPreviousFireTime, setStartTime, setTimeZone, triggered, updateAfterMisfire, updateWithNewCalendar, validateMisfireInstruction, willFireOn, willFireOn |
Methods inherited from class org.quartz.Trigger |
---|
addTriggerListener, clearAllTriggerListeners, compareTo, equals, getCalendarName, getDescription, getFireInstanceId, getFullJobName, getFullName, getGroup, getJobDataMap, getJobGroup, getJobName, getKey, getMisfireInstruction, getName, getPriority, getTriggerListenerNames, hashCode, isVolatile, removeTriggerListener, setCalendarName, setDescription, setFireInstanceId, setGroup, setJobDataMap, setJobGroup, setJobName, setMisfireInstruction, setName, setPriority, setVolatility, toString, validate |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CronTriggerBean()
Method Detail |
---|
public void setJobDataAsMap(java.util.Map<java.lang.String,?> 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)
CronTrigger
class.
Default is MISFIRE_INSTRUCTION_SMART_POLICY
.
CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW
,
CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING
,
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(org.quartz.TriggerListener[])
,
TriggerListener.getName()
public void setStartDelay(long startDelay)
The start delay is added to the current system time (when the bean starts)
to control the 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 millisecondspublic void setJobDetail(org.quartz.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.
Trigger.setJobName(java.lang.String)
,
Trigger.setJobGroup(java.lang.String)
public org.quartz.JobDetail getJobDetail()
JobDetailAwareTrigger
getJobDetail
in interface JobDetailAwareTrigger
null
if nonepublic void setBeanName(java.lang.String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void afterPropertiesSet() throws java.lang.Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
java.lang.Exception
|
spring-context-support | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |