|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
org.quartz.locality Class DelegatingLocalityTrigger
java.lang.Objectorg.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 Triggers 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
LocalityAwareTrigger, wrapping an existing Trigger instance, with additional NodeSpec
| Method Detail |
|---|
getNodeSpec
public NodeSpec getNodeSpec()
- Accessor to the
NodeSpecinstance to evaluate constraints - Specified by:
getNodeSpecin interfaceLocalityAware
- Returns:
getKey
public TriggerKey getKey()
getJobKey
public JobKey getJobKey()
getDescription
public String getDescription()
- Return the description given to the
Triggerinstance by its creator (if any). - Specified by:
getDescriptionin interfaceTrigger
- Returns:
- null if no description was set.
getCalendarName
public String getCalendarName()
- Get the name of the
Calendarassociated with this Trigger. - Specified by:
getCalendarNamein interfaceTrigger
- Returns:
nullif there is no associated Calendar.
getJobDataMap
public JobDataMap getJobDataMap()
- Get the
JobDataMapthat 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:
getJobDataMapin interfaceTrigger
getPriority
public int getPriority()
- The priority of a
Triggeracts as a tiebreaker such that if twoTriggers 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:
getPriorityin interfaceTrigger
- See Also:
Trigger.DEFAULT_PRIORITY
mayFireAgain
public boolean mayFireAgain()
- Used by the
Schedulerto determine whether or not it is possible for thisTriggerto fire again.If the returned value is
falsethen theSchedulermay remove theTriggerfrom theJobStore. - Specified by:
mayFireAgainin interfaceTrigger
getStartTime
public Date getStartTime()
- Get the time at which the
Triggershould occur. - Specified by:
getStartTimein interfaceTrigger
getEndTime
public Date getEndTime()
- Get the time at which the
Triggershould quit repeating - regardless of any remaining repeats (based on the trigger's particular repeat settings). - Specified by:
getEndTimein interfaceTrigger
- See Also:
Trigger.getFinalFireTime()
getNextFireTime
public Date getNextFireTime()
- Returns the next time at which the
Triggeris scheduled to fire. If the trigger will not fire again,nullwill 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
Triggerhas been added to the scheduler. - Specified by:
getNextFireTimein interfaceTrigger
- See Also:
TriggerUtils#computeFireTimesBetween(Trigger, Calendar, Date, Date)
getPreviousFireTime
public Date getPreviousFireTime()
- Returns the previous time at which the
Triggerfired. If the trigger has not yet fired,nullwill be returned. - Specified by:
getPreviousFireTimein interfaceTrigger
getFireTimeAfter
public Date getFireTimeAfter(Date afterTime)
- Returns the next time at which the
Triggerwill fire, after the given time. If the trigger will not fire after the given time,nullwill be returned. - Specified by:
getFireTimeAfterin interfaceTrigger
getFinalFireTime
public Date getFinalFireTime()
- Returns the last time at which the
Triggerwill fire, if the Trigger will repeat indefinitely, null will be returned.Note that the return time *may* be in the past.
- Specified by:
getFinalFireTimein interfaceTrigger
getMisfireInstruction
public int getMisfireInstruction()
- Get the instruction the
Schedulershould be given for handling misfire situations for thisTrigger- the concreteTriggertype that you are using will have defined a set of additionalMISFIRE_INSTRUCTION_XXXconstants that may be set as this property's value.If not explicitly set, the default value is
MISFIRE_INSTRUCTION_SMART_POLICY. - Specified by:
getMisfireInstructionin 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
Triggerto 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:
compareToin interfaceComparable<Trigger>- Specified by:
compareToin interfaceTrigger
getTriggerBuilder
public TriggerBuilder<Trigger> getTriggerBuilder()
- Get a
TriggerBuilderthat is configured to produce aTriggeridentical to this one. - Specified by:
getTriggerBuilderin interfaceTrigger
- See Also:
Trigger.getScheduleBuilder()
getScheduleBuilder
public ScheduleBuilder<Trigger> getScheduleBuilder()
- Get a
ScheduleBuilderthat is configured to produce a schedule identical to this trigger's schedule. - Specified by:
getScheduleBuilderin interfaceTrigger
- See Also:
Trigger.getTriggerBuilder()
setKey
public void setKey(TriggerKey key)
-
- Specified by:
setKeyin interfaceorg.quartz.spi.MutableTrigger
setJobKey
public void setJobKey(JobKey key)
-
- Specified by:
setJobKeyin interfaceorg.quartz.spi.MutableTrigger
setDescription
public void setDescription(String description)
-
- Specified by:
setDescriptionin interfaceorg.quartz.spi.MutableTrigger
setCalendarName
public void setCalendarName(String calendarName)
-
- Specified by:
setCalendarNamein interfaceorg.quartz.spi.MutableTrigger
setJobDataMap
public void setJobDataMap(JobDataMap jobDataMap)
-
- Specified by:
setJobDataMapin interfaceorg.quartz.spi.MutableTrigger
setPriority
public void setPriority(int priority)
-
- Specified by:
setPriorityin interfaceorg.quartz.spi.MutableTrigger
setStartTime
public void setStartTime(Date startTime)
-
- Specified by:
setStartTimein interfaceorg.quartz.spi.MutableTrigger
setEndTime
public void setEndTime(Date endTime)
-
- Specified by:
setEndTimein interfaceorg.quartz.spi.MutableTrigger
setMisfireInstruction
public void setMisfireInstruction(int misfireInstruction)
-
- Specified by:
setMisfireInstructionin interfaceorg.quartz.spi.MutableTrigger
triggered
public void triggered(Calendar calendar)
-
- Specified by:
triggeredin interfaceorg.quartz.spi.OperableTrigger
computeFirstFireTime
public Date computeFirstFireTime(Calendar calendar)
-
- Specified by:
computeFirstFireTimein interfaceorg.quartz.spi.OperableTrigger
executionComplete
public Trigger.CompletedExecutionInstruction executionComplete(JobExecutionContext context, JobExecutionException result)
-
- Specified by:
executionCompletein interfaceorg.quartz.spi.OperableTrigger
updateAfterMisfire
public void updateAfterMisfire(Calendar cal)
-
- Specified by:
updateAfterMisfirein interfaceorg.quartz.spi.OperableTrigger
updateWithNewCalendar
public void updateWithNewCalendar(Calendar cal, long misfireThreshold)
-
- Specified by:
updateWithNewCalendarin interfaceorg.quartz.spi.OperableTrigger
validate
public void validate()
throws SchedulerException
-
- Specified by:
validatein interfaceorg.quartz.spi.OperableTrigger
- Throws:
SchedulerException
setFireInstanceId
public void setFireInstanceId(String id)
-
- Specified by:
setFireInstanceIdin interfaceorg.quartz.spi.OperableTrigger
getFireInstanceId
public String getFireInstanceId()
-
- Specified by:
getFireInstanceIdin interfaceorg.quartz.spi.OperableTrigger
setNextFireTime
public void setNextFireTime(Date nextFireTime)
-
- Specified by:
setNextFireTimein interfaceorg.quartz.spi.OperableTrigger
setPreviousFireTime
public void setPreviousFireTime(Date previousFireTime)
-
- Specified by:
setPreviousFireTimein 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.
org.quartz.locality.DelegatingLocalityTrigger