org.quartz
Interface TriggerListener

All Known Implementing Classes:
LoggingTriggerHistoryPlugin

public interface TriggerListener

The interface to be implemented by classes that want to be informed when a Trigger fires. In general, applications that use a Scheduler will not have use for this mechanism.

Author:
James House
See Also:
Scheduler, Trigger, JobListener, JobExecutionContext

Method Summary
 String getName()
           Get the name of the TriggerListener.
 void triggerComplete(Trigger trigger, JobExecutionContext context, int triggerInstructionCode)
           Called by the Scheduler when a Trigger has fired, it's associated JobDetail has been executed, and it's triggered(xx) method has been called.
 void triggerFired(Trigger trigger, JobExecutionContext context)
           Called by the Scheduler when a Trigger has fired, and it's associated JobDetail is about to be executed.
 void triggerMisfired(Trigger trigger)
           Called by the Scheduler when a Trigger has misfired.
 boolean vetoJobExecution(Trigger trigger, JobExecutionContext context)
           Called by the Scheduler when a Trigger has fired, and it's associated JobDetail is about to be executed.
 

Method Detail

getName

public String getName()

Get the name of the TriggerListener.


triggerFired

public void triggerFired(Trigger trigger,
                         JobExecutionContext context)

Called by the Scheduler when a Trigger has fired, and it's associated JobDetail is about to be executed.

It is called before the vetoJobExecution(..) method of this interface.

Parameters:
trigger - The Trigger that has fired.
context - The JobExecutionContext that will be passed to the Job'sexecute(xx) method.

vetoJobExecution

public boolean vetoJobExecution(Trigger trigger,
                                JobExecutionContext context)

Called by the Scheduler when a Trigger has fired, and it's associated JobDetail is about to be executed.

It is called after the triggerFired(..) method of this interface.

Parameters:
trigger - The Trigger that has fired.
context - The JobExecutionContext that will be passed to the Job'sexecute(xx) method.

triggerMisfired

public void triggerMisfired(Trigger trigger)

Called by the Scheduler when a Trigger has misfired.

Consideration 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 - The Trigger that has misfired.

triggerComplete

public void triggerComplete(Trigger trigger,
                            JobExecutionContext context,
                            int triggerInstructionCode)

Called by the Scheduler when a Trigger has fired, it's associated JobDetail has been executed, and it's triggered(xx) method has been called.

Parameters:
trigger - The Trigger that was fired.
context - The JobExecutionContext that was passed to the Job'sexecute(xx) method.

Quartz Enterprise Job Scheduler Project Page