public abstract class AbstractTrigger extends Object implements OperableTrigger
The base abstract class to be extended by all Triggers.
Triggers s have a name and group associated with them, which should uniquely identify them within a single
.
Scheduler
Triggers are the 'mechanism' by which Job s are scheduled. Many Trigger s can point to the same
Job, but a single Trigger can only point to one Job.
Triggers can 'send' parameters/data to Jobs by placing contents into the JobDataMap on the Trigger.
Trigger.CompletedExecutionInstruction, Trigger.TriggerTimeComparator| Modifier and Type | Field and Description |
|---|---|
protected Date |
endTime |
protected Date |
nextFireTime |
protected Date |
previousFireTime |
protected Date |
startTime |
DEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY| Constructor and Description |
|---|
AbstractTrigger()
Create a
Trigger with no specified name, group, or . |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
int |
compareTo(Trigger other)
Compare the next fire time of this
Trigger to that of another by comparing their keys, or in other words, sorts them according to
the natural (i.e. |
boolean |
equals(Object o)
Trigger equality is based upon the equality of the Trigger name.
|
Trigger.CompletedExecutionInstruction |
executionComplete(JobExecutionContext context,
JobExecutionException result)
This method should not be used by the Quartz client.
|
String |
getCalendarName()
Get the name of the
associated with this Trigger. |
String |
getDescription()
Return the description given to the
Trigger instance by its creator (if any). |
String |
getFireInstanceId()
This method should not be used by the Quartz client.
|
JobDataMap |
getJobDataMap()
Get the
JobDataMap that is associated with the Trigger. |
String |
getJobName()
Get the name of the associated
. |
int |
getMisfireInstruction()
Get the instruction the
Scheduler should be given for handling misfire situations for this Trigger- the concrete
Trigger type that you are using will have defined a set of additional MISFIRE_INSTRUCTION_XXX constants that may be set
as this property's value. |
String |
getName()
Get the name of this
Trigger. |
int |
getPriority()
The priority of a
Trigger acts as a tiebreaker such that if two Triggers have the same scheduled fire time, then the
one with the higher priority will get first access to a worker thread. |
int |
hashCode() |
void |
setCalendarName(String calendarName)
Associate the
with the given name with this Trigger. |
void |
setDescription(String description)
Set a description for the
Trigger instance - may be useful for remembering/displaying the purpose of the trigger, though the
description has no meaning to Quartz. |
void |
setFireInstanceId(String id)
This method should not be used by the Quartz client.
|
void |
setJobDataMap(JobDataMap jobDataMap)
Set the
JobDataMap to be associated with the Trigger. |
void |
setJobName(String jobName)
Set the name of the associated
. |
void |
setMisfireInstruction(int misfireInstruction)
Set the instruction the
Scheduler should be given for handling misfire situations for this Trigger- the concrete
Trigger type that you are using will have defined a set of additional MISFIRE_INSTRUCTION_XXX constants that may be
passed to this method. |
void |
setName(String name)
Set the name of this
Trigger. |
void |
setPriority(int priority)
The priority of a
Trigger acts as a tie breaker such that if two Triggers have the same scheduled fire time, then
Quartz will do its best to give the one with the higher priority first access to a worker thread. |
String |
toString() |
void |
validate()
Validates whether the properties of the
JobDetail are valid for submission into a Scheduler. |
protected abstract boolean |
validateMisfireInstruction(int misfireInstruction) |
finalize, getClass, notify, notifyAll, wait, wait, waitcomputeFirstFireTime, setNextFireTime, setPreviousFireTime, triggered, updateAfterMisfiresetEndTime, setStartTimegetEndTime, getFinalFireTime, getFireTimeAfter, getNextFireTime, getPreviousFireTime, getStartTime, mayFireAgainprotected Date startTime
protected Date endTime
protected Date nextFireTime
protected Date previousFireTime
public AbstractTrigger()
Create a Trigger with no specified name, group, or .
JobDetail
Note that the setName(String)and the setJobName(String) methods must be called before the Trigger can be placed
into a Scheduler.
protected abstract boolean validateMisfireInstruction(int misfireInstruction)
public String getName()
Trigger
Get the name of this Trigger.
public String getJobName()
Trigger
Get the name of the associated .
JobDetail
getJobName in interface Triggerpublic void setName(String name)
MutableTrigger
Set the name of this Trigger.
setName in interface MutableTriggerpublic void setJobName(String jobName)
MutableTrigger
Set the name of the associated .
JobDetail
setJobName in interface MutableTriggerpublic String getDescription()
TriggerTrigger instance by its creator (if any).getDescription in interface Triggerpublic void setDescription(String description)
MutableTrigger
Set a description for the Trigger instance - may be useful for remembering/displaying the purpose of the trigger, though the
description has no meaning to Quartz.
setDescription in interface MutableTriggerpublic void setCalendarName(String calendarName)
MutableTrigger
Associate the with the given name with this Trigger.
Calendar
setCalendarName in interface MutableTriggercalendarName - use null to dis-associate a Calendar.public String getCalendarName()
TriggerCalendar associated with this Trigger.getCalendarName in interface Triggernull if there is no associated Calendar.public JobDataMap getJobDataMap()
TriggerJobDataMap that is associated with the Trigger.
Changes made to this map during job execution are not re-persisted, and in fact typically result in an IllegalStateException.
getJobDataMap in interface Triggerpublic void setJobDataMap(JobDataMap jobDataMap)
MutableTrigger
Set the JobDataMap to be associated with the Trigger.
setJobDataMap in interface MutableTriggerpublic int getPriority()
TriggerTrigger acts as a tiebreaker such that if two Triggers have the same scheduled fire time, then the
one with the higher priority will get first access to a worker thread.
If not explicitly set, the default value is 5.
getPriority in interface TriggerTrigger.DEFAULT_PRIORITYpublic void setPriority(int priority)
MutableTriggerTrigger acts as a tie breaker such that if two Triggers have the same scheduled fire time, then
Quartz will do its best to give the one with the higher priority first access to a worker thread.
If not explicitly set, the default value is 5.
setPriority in interface MutableTriggerTrigger.DEFAULT_PRIORITYpublic int getMisfireInstruction()
TriggerScheduler should be given for handling misfire situations for this Trigger- the concrete
Trigger type that you are using will have defined a set of additional MISFIRE_INSTRUCTION_XXX constants that may be set
as this property's value.
If not explicitly set, the default value is MISFIRE_INSTRUCTION_SMART_POLICY.
getMisfireInstruction in interface TriggerTrigger.MISFIRE_INSTRUCTION_SMART_POLICY,
#updateAfterMisfire(Calendar),
SimpleTrigger,
CronTriggerpublic void setMisfireInstruction(int misfireInstruction)
MutableTrigger
Set the instruction the Scheduler should be given for handling misfire situations for this Trigger- the concrete
Trigger type that you are using will have defined a set of additional MISFIRE_INSTRUCTION_XXX constants that may be
passed to this method.
If not explicitly set, the default value is MISFIRE_INSTRUCTION_SMART_POLICY.
setMisfireInstruction in interface MutableTriggerTrigger.MISFIRE_INSTRUCTION_SMART_POLICY,
#updateAfterMisfire(Calendar),
SimpleTrigger,
CronTriggerpublic Trigger.CompletedExecutionInstruction executionComplete(JobExecutionContext context, JobExecutionException result)
OperableTriggerThis method should not be used by the Quartz client.
Called after the has executed the Scheduler associated with the
JobDetailTrigger in order to get the final instruction code from the trigger.
executionComplete in interface OperableTriggercontext - is the JobExecutionContext that was used by the Job'sexecute(xx) method.result - is the JobExecutionException thrown by the Job, if any (may be null).CompletedExecutionInstruction constants.CompletedExecutionInstruction,
OperableTrigger.triggered(Calendar)public void validate()
throws SchedulerException
OperableTrigger
Validates whether the properties of the JobDetail are valid for submission into a Scheduler.
validate in interface OperableTriggerSchedulerExceptionpublic void setFireInstanceId(String id)
OperableTriggerThis method should not be used by the Quartz client.
Usable by implementations, in order to facilitate 'recognizing' instances of fired
JobStoreTrigger s as their jobs complete execution.
setFireInstanceId in interface OperableTriggerpublic String getFireInstanceId()
OperableTriggerThis method should not be used by the Quartz client.
getFireInstanceId in interface OperableTriggerpublic int compareTo(Trigger other)
Compare the next fire time of this Trigger to that of another by comparing their keys, or in other words, sorts them according to
the natural (i.e. alphabetical) order of their keys.
compareTo in interface Comparable<Trigger>public boolean equals(Object o)
public Object clone()
clone in interface MutableTriggerclone in class ObjectCopyright © 2011–2017 Knowm Inc.. All rights reserved.