|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.Trigger org.quartz.SimpleTrigger org.springframework.scheduling.quartz.SimpleTriggerBean
public class SimpleTriggerBean
Convenience subclass of Quartz' SimpleTrigger class that eases bean-style usage.
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 JobDetail. This allows SchedulerFactoryBean to automatically register a trigger for the respective JobDetail, instead of registering the JobDetail separately.
Trigger.setName(java.lang.String)
,
Trigger.setGroup(java.lang.String)
,
SimpleTrigger.setStartTime(java.util.Date)
,
Trigger.setJobName(java.lang.String)
,
Trigger.setJobGroup(java.lang.String)
,
setJobDetail(org.quartz.JobDetail)
,
SchedulerFactoryBean.setTriggers(org.quartz.Trigger[])
,
SchedulerFactoryBean.setJobDetails(org.quartz.JobDetail[])
,
Serialized FormField Summary |
---|
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(String beanName)
Set the name of the bean in the bean factory that created this bean. |
void |
setJobDetail(JobDetail jobDetail)
Set the JobDetail that this trigger should be associated with. |
void |
setMisfireInstructionName(String constantName)
Set the misfire instruction via the name of the corresponding constant in the SimpleTrigger class. |
void |
setStartDelay(long startDelay)
Set the delay before starting the job for the first time. |
void |
setTriggerListenerNames(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.Trigger |
---|
addTriggerListener, clone, compareTo, equals, getCalendarName, getDescription, getFireInstanceId, getFullJobName, getFullName, getGroup, getJobDataMap, getJobGroup, getJobName, getMisfireInstruction, getName, getTriggerListenerNames, hashCode, isVolatile, removeTriggerListener, setCalendarName, setDescription, setFireInstanceId, setGroup, setJobDataMap, setJobGroup, setJobName, setMisfireInstruction, setName, setVolatility, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleTriggerBean()
Method Detail |
---|
public void setMisfireInstructionName(String constantName)
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 setTriggerListenerNames(String[] names)
A TriggerListener name always refers to the name returned by the TriggerListener implementation.
SchedulerFactoryBean.setTriggerListeners(org.quartz.TriggerListener[])
,
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.
SimpleTrigger.setStartTime(java.util.Date)
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.
Trigger.setJobName(java.lang.String)
,
Trigger.setJobGroup(java.lang.String)
public JobDetail getJobDetail()
JobDetailAwareTrigger
getJobDetail
in interface JobDetailAwareTrigger
null
if nonepublic void setBeanName(String beanName)
BeanNameAware
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method.
setBeanName
in interface BeanNameAware
beanName
- the name of the bean in the factorypublic void afterPropertiesSet() throws 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
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |