|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
org.quartz.plugins.history Class LoggingTriggerHistoryPlugin
java.lang.Objectorg.quartz.plugins.history.LoggingTriggerHistoryPlugin
- All Implemented Interfaces:
- org.quartz.spi.SchedulerPlugin, TriggerListener
public class LoggingTriggerHistoryPlugin
- extends Object
- implements org.quartz.spi.SchedulerPlugin, TriggerListener
Logs a history of all trigger firings via the Jakarta Commons-Logging framework.
The logged message is customizable by setting one of the following message
properties to a String that conforms to the syntax of java.util.MessageFormat.
TriggerFiredMessage - available message data are:
| Element | Data Type | Description |
|---|---|---|
| 0 | String | The Trigger's Name. |
| 1 | String | The Trigger's Group. |
| 2 | Date | The scheduled fire time. |
| 3 | Date | The next scheduled fire time. |
| 4 | Date | The actual fire time. |
| 5 | String | The Job's name. |
| 6 | String | The Job's group. |
| 7 | Integer | The re-fire count from the JobExecutionContext. |
TriggerMisfiredMessage - available message data are:
| Element | Data Type | Description |
|---|---|---|
| 0 | String | The Trigger's Name. |
| 1 | String | The Trigger's Group. |
| 2 | Date | The scheduled fire time. |
| 3 | Date | The next scheduled fire time. |
| 4 | Date | The actual fire time. (the time the misfire was detected/handled) |
| 5 | String | The Job's name. |
| 6 | String | The Job's group. |
TriggerCompleteMessage - available message data are:
| Element | Data Type | Description |
|---|---|---|
| 0 | String | The Trigger's Name. |
| 1 | String | The Trigger's Group. |
| 2 | Date | The scheduled fire time. |
| 3 | Date | The next scheduled fire time. |
| 4 | Date | The job completion time. |
| 5 | String | The Job's name. |
| 6 | String | The Job's group. |
| 7 | Integer | The re-fire count from the JobExecutionContext. |
| 8 | Integer | The trigger's resulting instruction code. |
| 9 | String | A human-readable translation of the trigger's resulting instruction code. |
- Author:
- James House
| Constructor Summary | |
|---|---|
LoggingTriggerHistoryPlugin()
|
|
| Method Summary | |
|---|---|
protected org.slf4j.Logger |
getLog()
|
String |
getName()
Get the name of the TriggerListener. |
String |
getTriggerCompleteMessage()
Get the message that is printed upon the completion of a trigger's firing. |
String |
getTriggerFiredMessage()
Get the message that is printed upon a trigger's firing. |
String |
getTriggerMisfiredMessage()
Get the message that is printed upon a trigger's mis-firing. |
void |
initialize(String name,
Scheduler scheduler)
Called during creation of the Scheduler in order to give
the SchedulerPlugin a chance to initialize. |
void |
setTriggerCompleteMessage(String triggerCompleteMessage)
Set the message that is printed upon the completion of a trigger's firing. |
void |
setTriggerFiredMessage(String triggerFiredMessage)
Set the message that is printed upon a trigger's firing. |
void |
setTriggerMisfiredMessage(String triggerMisfiredMessage)
Set the message that is printed upon a trigger's firing. |
void |
shutdown()
Called in order to inform the SchedulerPlugin that it
should free up all of it's resources because the scheduler is shutting
down. |
void |
start()
|
void |
triggerComplete(Trigger trigger,
JobExecutionContext context,
Trigger.CompletedExecutionInstruction 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
LoggingTriggerHistoryPlugin
public LoggingTriggerHistoryPlugin()
| Method Detail |
|---|
getLog
protected org.slf4j.Logger getLog()
getTriggerCompleteMessage
public String getTriggerCompleteMessage()
- Get the message that is printed upon the completion of a trigger's
firing.
- Returns:
- String
getTriggerFiredMessage
public String getTriggerFiredMessage()
- Get the message that is printed upon a trigger's firing.
- Returns:
- String
getTriggerMisfiredMessage
public String getTriggerMisfiredMessage()
- Get the message that is printed upon a trigger's mis-firing.
- Returns:
- String
setTriggerCompleteMessage
public void setTriggerCompleteMessage(String triggerCompleteMessage)
- Set the message that is printed upon the completion of a trigger's
firing.
- Parameters:
triggerCompleteMessage- String in java.text.MessageFormat syntax.
setTriggerFiredMessage
public void setTriggerFiredMessage(String triggerFiredMessage)
- Set the message that is printed upon a trigger's firing.
- Parameters:
triggerFiredMessage- String in java.text.MessageFormat syntax.
setTriggerMisfiredMessage
public void setTriggerMisfiredMessage(String triggerMisfiredMessage)
- Set the message that is printed upon a trigger's firing.
- Parameters:
triggerMisfiredMessage- String in java.text.MessageFormat syntax.
initialize
public void initialize(String name, Scheduler scheduler) throws SchedulerException
Called during creation of the
Schedulerin order to give theSchedulerPlugina chance to initialize.- Specified by:
initializein interfaceorg.quartz.spi.SchedulerPlugin
- Throws:
SchedulerConfigException- if there is an error initializing.SchedulerException
start
public void start()
- Specified by:
startin interfaceorg.quartz.spi.SchedulerPlugin
shutdown
public void shutdown()
Called in order to inform the
SchedulerPluginthat it should free up all of it's resources because the scheduler is shutting down.- Specified by:
shutdownin interfaceorg.quartz.spi.SchedulerPlugin
getName
public String getName()
- Description copied from interface:
TriggerListener Get the name of the
TriggerListener.- Specified by:
getNamein interfaceTriggerListener
triggerFired
public void triggerFired(Trigger trigger, JobExecutionContext context)
- Description copied from interface:
TriggerListener Called by the
Schedulerwhen aTriggerhas fired, and it's associatedJobDetailis about to be executed.It is called before the
vetoJobExecution(..)method of this interface.- Specified by:
triggerFiredin interfaceTriggerListener
- Parameters:
trigger- TheTriggerthat has fired.context- TheJobExecutionContextthat will be passed to theJob'sexecute(xx)method.
triggerMisfired
public void triggerMisfired(Trigger trigger)
- Description copied from interface:
TriggerListener Called by the
Schedulerwhen aTriggerhas 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.
- Specified by:
triggerMisfiredin interfaceTriggerListener
- Parameters:
trigger- TheTriggerthat has misfired.
triggerComplete
public void triggerComplete(Trigger trigger, JobExecutionContext context, Trigger.CompletedExecutionInstruction triggerInstructionCode)
- Description copied from interface:
TriggerListener Called by the
Schedulerwhen aTriggerhas fired, it's associatedJobDetailhas been executed, and it'striggered(xx)method has been called.- Specified by:
triggerCompletein interfaceTriggerListener
- 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.
vetoJobExecution
public boolean vetoJobExecution(Trigger trigger, JobExecutionContext context)
- Description copied from interface:
TriggerListener Called by the
Schedulerwhen aTriggerhas fired, and it's associatedJobDetailis about to be executed. If the implementation vetos the execution (via returningtrue), the job's execute method will not be called.It is called after the
triggerFired(..)method of this interface.- Specified by:
vetoJobExecutionin interfaceTriggerListener
- Parameters:
trigger- TheTriggerthat has fired.context- TheJobExecutionContextthat will be passed to theJob'sexecute(xx)method.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2001-2011, Terracotta, Inc.
org.quartz.plugins.history.LoggingTriggerHistoryPlugin