Save This Page
Home » quartz-1.6.0 » org » quartz » plugins » history » [javadoc | source]
org.quartz.plugins.history
public class: LoggingJobHistoryPlugin [javadoc | source]
java.lang.Object
   org.quartz.plugins.history.LoggingJobHistoryPlugin

All Implemented Interfaces:
    JobListener, SchedulerPlugin

Logs a history of all job executions (and execution vetos) 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.

JobToBeFiredMessage - available message data are:
Element Data Type Description
0 String The Job's Name.
1 String The Job's Group.
2 Date The current time.
3 String The Trigger's name.
4 String The Triggers's group.
5 Date The scheduled fire time.
6 Date The next scheduled fire time.
7 Integer The re-fire count from the JobExecutionContext.
The default message text is "Job {1}.{0} fired (by trigger {4}.{3}) at: {2, date, HH:mm:ss MM/dd/yyyy}"

JobSuccessMessage - available message data are:
Element Data Type Description
0 String The Job's Name.
1 String The Job's Group.
2 Date The current time.
3 String The Trigger's name.
4 String The Triggers's group.
5 Date The scheduled fire time.
6 Date The next scheduled fire time.
7 Integer The re-fire count from the JobExecutionContext.
8 Object The string value (toString() having been called) of the result (if any) that the Job set on the JobExecutionContext, with on it. "NULL" if no result was set.
The default message text is "Job {1}.{0} execution complete at {2, date, HH:mm:ss MM/dd/yyyy} and reports: {8}"

JobFailedMessage - available message data are:
Element Data Type Description
0 String The Job's Name.
1 String The Job's Group.
2 Date The current time.
3 String The Trigger's name.
4 String The Triggers's group.
5 Date The scheduled fire time.
6 Date The next scheduled fire time.
7 Integer The re-fire count from the JobExecutionContext.
8 String The message from the thrown JobExecution Exception.
The default message text is "Job {1}.{0} execution failed at {2, date, HH:mm:ss MM/dd/yyyy} and reports: {8}"

JobWasVetoedMessage - available message data are:
Element Data Type Description
0 String The Job's Name.
1 String The Job's Group.
2 Date The current time.
3 String The Trigger's name.
4 String The Triggers's group.
5 Date The scheduled fire time.
6 Date The next scheduled fire time.
7 Integer The re-fire count from the JobExecutionContext.
The default message text is "Job {1}.{0} was vetoed. It was to be fired (by trigger {4}.{3}) at: {2, date, HH:mm:ss MM/dd/yyyy}"

Constructor:
 public LoggingJobHistoryPlugin() 
Method from org.quartz.plugins.history.LoggingJobHistoryPlugin Summary:
getJobFailedMessage,   getJobSuccessMessage,   getJobToBeFiredMessage,   getJobWasVetoedMessage,   getLog,   getName,   initialize,   jobExecutionVetoed,   jobToBeExecuted,   jobWasExecuted,   setJobFailedMessage,   setJobSuccessMessage,   setJobToBeFiredMessage,   setJobWasVetoedMessage,   shutdown,   start
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.quartz.plugins.history.LoggingJobHistoryPlugin Detail:
 public String getJobFailedMessage() 
    Get the message that is logged when a Job fails its execution.
 public String getJobSuccessMessage() 
    Get the message that is logged when a Job successfully completes its execution.
 public String getJobToBeFiredMessage() 
    Get the message that is logged when a Job is about to execute.
 public String getJobWasVetoedMessage() 
    Get the message that is logged when a Job execution is vetoed by a trigger listener.
 protected Log getLog() 
 public String getName() 
 public  void initialize(String name,
    Scheduler scheduler) throws SchedulerException 

    Called during creation of the Scheduler in order to give the SchedulerPlugin a chance to initialize.

 public  void jobExecutionVetoed(JobExecutionContext context) 
 public  void jobToBeExecuted(JobExecutionContext context) 
 public  void jobWasExecuted(JobExecutionContext context,
    JobExecutionException jobException) 
 public  void setJobFailedMessage(String jobFailedMessage) 
    Set the message that is logged when a Job fails its execution.
 public  void setJobSuccessMessage(String jobSuccessMessage) 
    Set the message that is logged when a Job successfully completes its execution.
 public  void setJobToBeFiredMessage(String jobToBeFiredMessage) 
    Set the message that is logged when a Job is about to execute.
 public  void setJobWasVetoedMessage(String jobWasVetoedMessage) 
    Set the message that is logged when a Job execution is vetoed by a trigger listener.
 public  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.

 public  void start()