|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Trigger
The base interface with properties common to all Triggers -
use TriggerBuilder to instantiate an actual Trigger.
Triggerss have a TriggerKey associated with them, which
should uniquely identify them within a single .
Scheduler
Triggers are the 'mechanism' by which Jobs
are scheduled. Many Triggers 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.
TriggerBuilder,
JobDataMap,
JobExecutionContext,
TriggerUtils,
SimpleTrigger,
CronTrigger,
CalendarIntervalTrigger,
NthIncludedDayTrigger| Nested Class Summary | |
|---|---|
static class |
Trigger.CompletedExecutionInstruction
NOOP Instructs the that the
has no further instructions. |
static class |
Trigger.TriggerState
|
static class |
Trigger.TriggerTimeComparator
A Comparator that compares trigger's next fire times, or in other words, sorts them according to earliest next fire time. |
| Field Summary | |
|---|---|
static int |
DEFAULT_PRIORITY
The default value for priority. |
static int |
MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
Instructs the that the
Trigger will never be evaluated for a misfire situation,
and that the scheduler will simply try to fire it as soon as it can,
and then update the Trigger as if it had fired at the proper time. |
static int |
MISFIRE_INSTRUCTION_SMART_POLICY
Instructs the that upon a mis-fire
situation, the updateAfterMisfire() method will be called
on the Trigger to determine the mis-fire instruction,
which logic will be trigger-implementation-dependent. |
static long |
serialVersionUID
|
| Method Summary | |
|---|---|
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(java.lang.Object other)
Trigger equality is based upon the equality of the TriggerKey. |
java.lang.String |
getCalendarName()
Get the name of the associated with this
Trigger. |
java.lang.String |
getDescription()
Return the description given to the Trigger instance by
its creator (if any). |
java.util.Date |
getEndTime()
Get the time at which the Trigger should quit repeating -
regardless of any remaining repeats (based on the trigger's particular
repeat settings). |
java.util.Date |
getFinalFireTime()
Returns the last time at which the Trigger will fire, if
the Trigger will repeat indefinitely, null will be returned. |
java.util.Date |
getFireTimeAfter(java.util.Date afterTime)
Returns the next time at which the Trigger will fire,
after the given time. |
JobDataMap |
getJobDataMap()
Get the JobDataMap that is associated with the
Trigger. |
JobKey |
getJobKey()
|
TriggerKey |
getKey()
|
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. |
java.util.Date |
getNextFireTime()
Returns the next time at which the Trigger is scheduled to fire. |
java.util.Date |
getPreviousFireTime()
Returns the previous time at which the Trigger fired. |
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. |
ScheduleBuilder<? extends Trigger> |
getScheduleBuilder()
Get a ScheduleBuilder that is configured to produce a
schedule identical to this trigger's schedule. |
java.util.Date |
getStartTime()
Get the time at which the Trigger should occur. |
TriggerBuilder<? extends Trigger> |
getTriggerBuilder()
Get a TriggerBuilder that is configured to produce a
Trigger identical to this one. |
boolean |
mayFireAgain()
Used by the to determine whether or not
it is possible for this Trigger to fire again. |
| Field Detail |
|---|
static final long serialVersionUID
static final int MISFIRE_INSTRUCTION_SMART_POLICY
Scheduler that upon a mis-fire
situation, the updateAfterMisfire() method will be called
on the Trigger to determine the mis-fire instruction,
which logic will be trigger-implementation-dependent.
In order to see if this instruction fits your needs, you should look at
the documentation for the getSmartMisfirePolicy() method
on the particular Trigger implementation you are using.
static final int MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY
Scheduler that the
Trigger will never be evaluated for a misfire situation,
and that the scheduler will simply try to fire it as soon as it can,
and then update the Trigger as if it had fired at the proper time.
NOTE: if a trigger uses this instruction, and it has missed several of its scheduled firings, then
static final int DEFAULT_PRIORITY
| Method Detail |
|---|
TriggerKey getKey()
JobKey getJobKey()
java.lang.String getDescription()
Trigger instance by
its creator (if any).
java.lang.String getCalendarName()
Calendar associated with this
Trigger.
null if there is no associated Calendar.JobDataMap getJobDataMap()
JobDataMap 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.
int getPriority()
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.
If not explicitly set, the default value is 5.
DEFAULT_PRIORITYboolean mayFireAgain()
Scheduler to determine whether or not
it is possible for this Trigger to fire again.
If the returned value is false then the Scheduler
may remove the Trigger from the .
JobStore
java.util.Date getStartTime()
Trigger should occur.
java.util.Date getEndTime()
Trigger should quit repeating -
regardless of any remaining repeats (based on the trigger's particular
repeat settings).
getFinalFireTime()java.util.Date getNextFireTime()
Trigger is scheduled to fire. If
the trigger will not fire again, null will be returned. Note that
the time returned can possibly be in the past, if the time that was computed
for the trigger to next fire has already arrived, but the scheduler has not yet
been able to fire the trigger (which would likely be due to lack of resources
e.g. threads).
The value returned is not guaranteed to be valid until after the Trigger
has been added to the scheduler.
TriggerUtils#computeFireTimesBetween(Trigger, Calendar, Date, Date)java.util.Date getPreviousFireTime()
Trigger fired.
If the trigger has not yet fired, null will be returned.
java.util.Date getFireTimeAfter(java.util.Date afterTime)
Trigger will fire,
after the given time. If the trigger will not fire after the given time,
null will be returned.
java.util.Date getFinalFireTime()
Trigger will fire, if
the Trigger will repeat indefinitely, null will be returned.
Note that the return time *may* be in the past.
int getMisfireInstruction()
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.
If not explicitly set, the default value is MISFIRE_INSTRUCTION_SMART_POLICY.
MISFIRE_INSTRUCTION_SMART_POLICY,
#updateAfterMisfire(Calendar),
SimpleTrigger,
CronTriggerTriggerBuilder<? extends Trigger> getTriggerBuilder()
TriggerBuilder that is configured to produce a
Trigger identical to this one.
getScheduleBuilder()ScheduleBuilder<? extends Trigger> getScheduleBuilder()
ScheduleBuilder that is configured to produce a
schedule identical to this trigger's schedule.
getTriggerBuilder()boolean equals(java.lang.Object other)
equals in class java.lang.Objectint 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 java.lang.Comparable<Trigger>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||