@MustImplementEqualsAndHashcode public interface ITrigger extends Comparable<ITrigger>
Triggers - use
TriggerBuilder to instantiate an actual Trigger.
Triggerss have a TriggerKey associated with them, which
should uniquely identify them within a single
.
IScheduler
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,
IJobExecutionContext,
TriggerUtils,
ISimpleTrigger,
ICronTrigger,
ICalendarIntervalTrigger| Modifier and Type | Interface and Description |
|---|---|
static class |
ITrigger.ECompletedExecutionInstruction
|
static class |
ITrigger.EMisfireInstruction |
static class |
ITrigger.ETriggerState |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PRIORITY
The default value for priority.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ITrigger 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. |
boolean |
equals(Object other)
Trigger equality is based upon the equality of the TriggerKey.
|
String |
getCalendarName()
Get the name of the
associated with this
Trigger. |
ITrigger |
getClone() |
String |
getDescription()
Return the description given to the
Trigger instance by its
creator (if any). |
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). |
Date |
getFinalFireTime()
Returns the last time at which the
Trigger will fire, if the
Trigger will repeat indefinitely, null will be returned. |
Date |
getFireTimeAfter(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() |
ITrigger.EMisfireInstruction |
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. |
Date |
getNextFireTime()
Returns the next time at which the
Trigger is scheduled to
fire. |
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. |
IScheduleBuilder<? extends IMutableTrigger> |
getScheduleBuilder()
Get a
IScheduleBuilder that is configured to produce a schedule
identical to this trigger's schedule. |
Date |
getStartTime()
Get the time at which the
Trigger should occur. |
TriggerBuilder<? extends ITrigger> |
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. |
static final int DEFAULT_PRIORITY
@Nullable TriggerKey getKey()
@Nullable String getDescription()
Trigger instance by its
creator (if any).null if no description was set.@Nullable String getCalendarName()
ICalendar associated with this
Trigger.null if there is no associated Calendar.@Nonnull JobDataMap getJobDataMap()
JobDataMap that is associated with the
Trigger.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.5.DEFAULT_PRIORITYboolean mayFireAgain()
IScheduler 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
.
IJobStore
Date getStartTime()
Trigger should occur.null depending on the implementation@Nullable Date getEndTime()
Trigger should quit repeating -
regardless of any remaining repeats (based on the trigger's particular
repeat settings).null.getFinalFireTime()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.
Date getPreviousFireTime()
Trigger fired. If the
trigger has not yet fired, null will be returned.Date getFireTimeAfter(Date afterTime)
Trigger will fire, after
the given time. If the trigger will not fire after the given time,
null will be returned.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.
ITrigger.EMisfireInstruction 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.
ISimpleTrigger,
ICronTriggerTriggerBuilder<? extends ITrigger> getTriggerBuilder()
TriggerBuilder that is configured to produce a
Trigger identical to this one.getScheduleBuilder()IScheduleBuilder<? extends IMutableTrigger> getScheduleBuilder()
IScheduleBuilder that is configured to produce a schedule
identical to this trigger's schedule.getTriggerBuilder()boolean equals(Object other)
int compareTo(ITrigger other)
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<ITrigger>Copyright © 2016–2021 Philip Helger. All rights reserved.