|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.quartz.locality Class DelegatingLocalityTrigger
java.lang.Object org.quartz.locality.DelegatingLocalityTrigger
- All Implemented Interfaces:
- Serializable, Cloneable, Comparable<Trigger>, LocalityAware, LocalityTrigger, org.quartz.spi.MutableTrigger, org.quartz.spi.OperableTrigger, Trigger
public class DelegatingLocalityTrigger
- extends Object
- implements LocalityTrigger, org.quartz.spi.OperableTrigger, Serializable
Wrapping a Trigger instance while adding the LocalityAware
contract
All Trigger
method calls will be delegated to the wrapped Trigger instance
- Author:
- Alex Snaps
- See Also:
- Serialized Form
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.quartz.Trigger |
---|
Trigger.CompletedExecutionInstruction, Trigger.TriggerState, Trigger.TriggerTimeComparator |
Field Summary |
---|
Fields inherited from interface org.quartz.Trigger |
---|
DEFAULT_PRIORITY, MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY, MISFIRE_INSTRUCTION_SMART_POLICY, serialVersionUID |
Constructor Summary | |
---|---|
DelegatingLocalityTrigger(Trigger trigger,
NodeSpec nodeSpec)
Constructs a LocalityAware Trigger, wrapping an existing Trigger instance, with additional NodeSpec |
Method Summary | |
---|---|
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. |
Date |
computeFirstFireTime(Calendar calendar)
|
Trigger.CompletedExecutionInstruction |
executionComplete(JobExecutionContext context,
JobExecutionException result)
|
String |
getCalendarName()
Get the name of the
Calendar associated with this
Trigger. |
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. |
String |
getFireInstanceId()
|
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()
|
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. |
Date |
getNextFireTime()
Returns the next time at which the Trigger is scheduled to fire. |
NodeSpec |
getNodeSpec()
Accessor to the NodeSpec instance to evaluate constraints |
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 Trigger s have the same scheduled fire time, then the
one with the higher priority will get first access to a worker
thread. |
ScheduleBuilder<Trigger> |
getScheduleBuilder()
Get a ScheduleBuilder 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<Trigger> |
getTriggerBuilder()
Get a TriggerBuilder that is configured to produce a
Trigger identical to this one. |
boolean |
mayFireAgain()
Used by the
Scheduler to determine whether or not
it is possible for this Trigger to fire again. |
void |
setCalendarName(String calendarName)
|
void |
setDescription(String description)
|
void |
setEndTime(Date endTime)
|
void |
setFireInstanceId(String id)
|
void |
setJobDataMap(JobDataMap jobDataMap)
|
void |
setJobKey(JobKey key)
|
void |
setKey(TriggerKey key)
|
void |
setMisfireInstruction(int misfireInstruction)
|
void |
setNextFireTime(Date nextFireTime)
|
void |
setPreviousFireTime(Date previousFireTime)
|
void |
setPriority(int priority)
|
void |
setStartTime(Date startTime)
|
void |
triggered(Calendar calendar)
|
void |
updateAfterMisfire(Calendar cal)
|
void |
updateWithNewCalendar(Calendar cal,
long misfireThreshold)
|
void |
validate()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.quartz.Trigger |
---|
equals |
Constructor Detail |
---|
DelegatingLocalityTrigger
public DelegatingLocalityTrigger(Trigger trigger, NodeSpec nodeSpec)
- Constructs a
LocalityAware
Trigger, wrapping an existing Trigger instance, with additional NodeSpec
Method Detail |
---|
getNodeSpec
public NodeSpec getNodeSpec()
- Accessor to the
NodeSpec
instance to evaluate constraints - Specified by:
getNodeSpec
in interfaceLocalityAware
- Returns:
getKey
public TriggerKey getKey()
getJobKey
public JobKey getJobKey()
getDescription
public String getDescription()
- Return the description given to the
Trigger
instance by its creator (if any). - Specified by:
getDescription
in interfaceTrigger
- Returns:
- null if no description was set.
getCalendarName
public String getCalendarName()
- Get the name of the
Calendar
associated with this Trigger. - Specified by:
getCalendarName
in interfaceTrigger
- Returns:
null
if there is no associated Calendar.
getJobDataMap
public JobDataMap getJobDataMap()
- Get the
JobDataMap
that is associated with theTrigger
.Changes made to this map during job execution are not re-persisted, and in fact typically result in an
IllegalStateException
. - Specified by:
getJobDataMap
in interfaceTrigger
getPriority
public int getPriority()
- The priority of a
Trigger
acts as a tiebreaker such that if twoTrigger
s 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
. - Specified by:
getPriority
in interfaceTrigger
- See Also:
Trigger.DEFAULT_PRIORITY
mayFireAgain
public boolean mayFireAgain()
- Used by the
Scheduler
to determine whether or not it is possible for thisTrigger
to fire again.If the returned value is
false
then theScheduler
may remove theTrigger
from theJobStore
. - Specified by:
mayFireAgain
in interfaceTrigger
getStartTime
public Date getStartTime()
- Get the time at which the
Trigger
should occur. - Specified by:
getStartTime
in interfaceTrigger
getEndTime
public 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). - Specified by:
getEndTime
in interfaceTrigger
- See Also:
Trigger.getFinalFireTime()
getNextFireTime
public Date getNextFireTime()
- Returns the next time at which the
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. - Specified by:
getNextFireTime
in interfaceTrigger
- See Also:
TriggerUtils#computeFireTimesBetween(Trigger, Calendar, Date, Date)
getPreviousFireTime
public Date getPreviousFireTime()
- Returns the previous time at which the
Trigger
fired. If the trigger has not yet fired,null
will be returned. - Specified by:
getPreviousFireTime
in interfaceTrigger
getFireTimeAfter
public Date getFireTimeAfter(Date afterTime)
- Returns the next time at which the
Trigger
will fire, after the given time. If the trigger will not fire after the given time,null
will be returned. - Specified by:
getFireTimeAfter
in interfaceTrigger
getFinalFireTime
public Date getFinalFireTime()
- Returns the last time at which the
Trigger
will fire, if the Trigger will repeat indefinitely, null will be returned.Note that the return time *may* be in the past.
- Specified by:
getFinalFireTime
in interfaceTrigger
getMisfireInstruction
public int getMisfireInstruction()
- Get the instruction the
Scheduler
should be given for handling misfire situations for thisTrigger
- the concreteTrigger
type that you are using will have defined a set of additionalMISFIRE_INSTRUCTION_XXX
constants that may be set as this property's value.If not explicitly set, the default value is
MISFIRE_INSTRUCTION_SMART_POLICY
. - Specified by:
getMisfireInstruction
in interfaceTrigger
- See Also:
Trigger.MISFIRE_INSTRUCTION_SMART_POLICY
,#updateAfterMisfire(Calendar)
,SimpleTrigger
,CronTrigger
compareTo
public 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.- Specified by:
compareTo
in interfaceComparable<Trigger>
- Specified by:
compareTo
in interfaceTrigger
getTriggerBuilder
public TriggerBuilder<Trigger> getTriggerBuilder()
- Get a
TriggerBuilder
that is configured to produce aTrigger
identical to this one. - Specified by:
getTriggerBuilder
in interfaceTrigger
- See Also:
Trigger.getScheduleBuilder()
getScheduleBuilder
public ScheduleBuilder<Trigger> getScheduleBuilder()
- Get a
ScheduleBuilder
that is configured to produce a schedule identical to this trigger's schedule. - Specified by:
getScheduleBuilder
in interfaceTrigger
- See Also:
Trigger.getTriggerBuilder()
setKey
public void setKey(TriggerKey key)
-
- Specified by:
setKey
in interfaceorg.quartz.spi.MutableTrigger
setJobKey
public void setJobKey(JobKey key)
-
- Specified by:
setJobKey
in interfaceorg.quartz.spi.MutableTrigger
setDescription
public void setDescription(String description)
-
- Specified by:
setDescription
in interfaceorg.quartz.spi.MutableTrigger
setCalendarName
public void setCalendarName(String calendarName)
-
- Specified by:
setCalendarName
in interfaceorg.quartz.spi.MutableTrigger
setJobDataMap
public void setJobDataMap(JobDataMap jobDataMap)
-
- Specified by:
setJobDataMap
in interfaceorg.quartz.spi.MutableTrigger
setPriority
public void setPriority(int priority)
-
- Specified by:
setPriority
in interfaceorg.quartz.spi.MutableTrigger
setStartTime
public void setStartTime(Date startTime)
-
- Specified by:
setStartTime
in interfaceorg.quartz.spi.MutableTrigger
setEndTime
public void setEndTime(Date endTime)
-
- Specified by:
setEndTime
in interfaceorg.quartz.spi.MutableTrigger
setMisfireInstruction
public void setMisfireInstruction(int misfireInstruction)
-
- Specified by:
setMisfireInstruction
in interfaceorg.quartz.spi.MutableTrigger
triggered
public void triggered(Calendar calendar)
-
- Specified by:
triggered
in interfaceorg.quartz.spi.OperableTrigger
computeFirstFireTime
public Date computeFirstFireTime(Calendar calendar)
-
- Specified by:
computeFirstFireTime
in interfaceorg.quartz.spi.OperableTrigger
executionComplete
public Trigger.CompletedExecutionInstruction executionComplete(JobExecutionContext context, JobExecutionException result)
-
- Specified by:
executionComplete
in interfaceorg.quartz.spi.OperableTrigger
updateAfterMisfire
public void updateAfterMisfire(Calendar cal)
-
- Specified by:
updateAfterMisfire
in interfaceorg.quartz.spi.OperableTrigger
updateWithNewCalendar
public void updateWithNewCalendar(Calendar cal, long misfireThreshold)
-
- Specified by:
updateWithNewCalendar
in interfaceorg.quartz.spi.OperableTrigger
validate
public void validate() throws SchedulerException
-
- Specified by:
validate
in interfaceorg.quartz.spi.OperableTrigger
- Throws:
SchedulerException
setFireInstanceId
public void setFireInstanceId(String id)
-
- Specified by:
setFireInstanceId
in interfaceorg.quartz.spi.OperableTrigger
getFireInstanceId
public String getFireInstanceId()
-
- Specified by:
getFireInstanceId
in interfaceorg.quartz.spi.OperableTrigger
setNextFireTime
public void setNextFireTime(Date nextFireTime)
-
- Specified by:
setNextFireTime
in interfaceorg.quartz.spi.OperableTrigger
setPreviousFireTime
public void setPreviousFireTime(Date previousFireTime)
-
- Specified by:
setPreviousFireTime
in interfaceorg.quartz.spi.OperableTrigger
clone
public Object clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2001-2011, Terracotta, Inc.