public class SimpleTriggerFactoryBean extends java.lang.Object implements org.springframework.beans.factory.FactoryBean<SimpleTrigger>, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
FactoryBean
for creating a Quartz SimpleTrigger
instance, supporting bean-style usage for trigger configuration.
SimpleTrigger(Impl)
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.
setName(java.lang.String)
,
setGroup(java.lang.String)
,
setStartDelay(long)
,
setJobDetail(org.quartz.JobDetail)
,
SchedulerAccessor.setTriggers(org.quartz.Trigger...)
,
SchedulerAccessor.setJobDetails(org.quartz.JobDetail...)
Constructor and Description |
---|
SimpleTriggerFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
JobDataMap |
getJobDataMap()
Return the trigger's JobDataMap.
|
SimpleTrigger |
getObject() |
java.lang.Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBeanName(java.lang.String beanName) |
void |
setDescription(java.lang.String description)
Associate a textual description with this trigger.
|
void |
setGroup(java.lang.String group)
Specify the trigger's group.
|
void |
setJobDataAsMap(java.util.Map<java.lang.String,?> jobDataAsMap)
Register objects in the JobDataMap via a given Map.
|
void |
setJobDataMap(JobDataMap jobDataMap)
Set the trigger's JobDataMap.
|
void |
setJobDetail(JobDetail jobDetail)
Set the JobDetail that this trigger should be associated with.
|
void |
setMisfireInstruction(int misfireInstruction)
Specify a misfire instruction for this trigger.
|
void |
setMisfireInstructionName(java.lang.String constantName)
Set the misfire instruction via the name of the corresponding
constant in the
SimpleTrigger class. |
void |
setName(java.lang.String name)
Specify the trigger's name.
|
void |
setPriority(int priority)
Specify the priority of this trigger.
|
void |
setRepeatCount(int repeatCount)
Specify the number of times this trigger is supposed to fire.
|
void |
setRepeatInterval(long repeatInterval)
Specify the interval between execution times of this trigger.
|
void |
setStartDelay(long startDelay)
Set the start delay in milliseconds.
|
void |
setStartTime(java.util.Date startTime)
Set a specific start time for the trigger.
|
public void setName(java.lang.String name)
public void setGroup(java.lang.String group)
public void setJobDetail(JobDetail jobDetail)
public void setJobDataMap(JobDataMap jobDataMap)
public JobDataMap getJobDataMap()
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)public void setStartTime(java.util.Date startTime)
Note that a dynamically computed setStartDelay(long)
specification
overrides a static timestamp set here.
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.
setStartTime(java.util.Date)
public void setRepeatInterval(long repeatInterval)
public void setRepeatCount(int repeatCount)
Default is to repeat indefinitely.
public void setPriority(int priority)
public void setMisfireInstruction(int misfireInstruction)
public void setMisfireInstructionName(java.lang.String constantName)
SimpleTrigger
class.
Default is MISFIRE_INSTRUCTION_SMART_POLICY
.SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW
,
SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT
,
SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT
,
SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT
,
SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT
,
Trigger.MISFIRE_INSTRUCTION_SMART_POLICY
public void setDescription(java.lang.String description)
public void setBeanName(java.lang.String beanName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
@Nullable public SimpleTrigger getObject()
getObject
in interface org.springframework.beans.factory.FactoryBean<SimpleTrigger>
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<SimpleTrigger>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<SimpleTrigger>