Interface TriggerListener
-
- All Known Implementing Classes:
BroadcastTriggerListener,JobInterruptMonitorPlugin,LoggingTriggerHistoryPlugin,TriggerListenerSupport
public interface TriggerListenerThe interface to be implemented by classes that want to be informed when afires. In general, applications that use aTriggerSchedulerwill not have use for this mechanism.- Author:
- James House
- See Also:
ListenerManager.addTriggerListener(TriggerListener, Matcher),Matcher,Trigger,JobListener,JobExecutionContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetName()Get the name of theTriggerListener.voidtriggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode)voidtriggerFired(Trigger trigger, JobExecutionContext context)voidtriggerMisfired(Trigger trigger)booleanvetoJobExecution(Trigger trigger, JobExecutionContext context)
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get the name of the
TriggerListener.
-
triggerFired
void triggerFired(Trigger trigger, JobExecutionContext context)
Called by the
when aSchedulerhas fired, and it's associatedTriggeris about to be executed.JobDetailIt is called before the
vetoJobExecution(..)method of this interface.- Parameters:
trigger- TheTriggerthat has fired.context- TheJobExecutionContextthat will be passed to theJob'sexecute(xx)method.
-
vetoJobExecution
boolean vetoJobExecution(Trigger trigger, JobExecutionContext context)
Called by the
when aSchedulerhas fired, and it's associatedTriggeris about to be executed. If the implementation vetoes the execution (via returningJobDetailtrue), the job's execute method will not be called.It is called after the
triggerFired(..)method of this interface.- Parameters:
trigger- TheTriggerthat has fired.context- TheJobExecutionContextthat will be passed to theJob'sexecute(xx)method.
-
triggerMisfired
void triggerMisfired(Trigger trigger)
Called by the
when aSchedulerhas misfired.TriggerConsideration should be given to how much time is spent in this method, as it will affect all triggers that are misfiring. If you have lots of triggers misfiring at once, it could be an issue it this method does a lot.
- Parameters:
trigger- TheTriggerthat has misfired.
-
triggerComplete
void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode)
Called by the
when aSchedulerhas fired, it's associatedTriggerhas been executed, and it'sJobDetailtriggered(xx)method has been called.- Parameters:
trigger- TheTriggerthat was fired.context- TheJobExecutionContextthat was passed to theJob'sexecute(xx)method.triggerInstructionCode- the result of the call on theTrigger'striggered(xx)method.
-
-