|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
org.quartz.plugins.history Class LoggingJobHistoryPlugin
java.lang.Object org.quartz.plugins.history.LoggingJobHistoryPlugin
- All Implemented Interfaces:
- JobListener, org.quartz.spi.SchedulerPlugin
public class LoggingJobHistoryPlugin
- extends Object
- implements org.quartz.spi.SchedulerPlugin, JobListener
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. |
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. |
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. |
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. |
- Author:
- James House
Constructor Summary | |
---|---|
LoggingJobHistoryPlugin()
|
Method Summary | |
---|---|
String |
getJobFailedMessage()
Get the message that is logged when a Job fails its execution. |
String |
getJobSuccessMessage()
Get the message that is logged when a Job successfully completes its execution. |
String |
getJobToBeFiredMessage()
Get the message that is logged when a Job is about to execute. |
String |
getJobWasVetoedMessage()
Get the message that is logged when a Job execution is vetoed by a trigger listener. |
protected org.slf4j.Logger |
getLog()
|
String |
getName()
Get the name of the JobListener . |
void |
initialize(String name,
Scheduler scheduler)
Called during creation of the Scheduler in order to give
the SchedulerPlugin a chance to initialize. |
void |
jobExecutionVetoed(JobExecutionContext context)
Called by the
Scheduler when a
JobDetail
was about to be executed (an associated
Trigger
has occurred), but a
TriggerListener vetoed it's
execution. |
void |
jobToBeExecuted(JobExecutionContext context)
Called by the
Scheduler when a
JobDetail
is about to be executed (an associated
Trigger
has occurred). |
void |
jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException)
Called by the
Scheduler after a
JobDetail
has been executed, and be for the associated Trigger 's
triggered(xx) method has been called. |
void |
setJobFailedMessage(String jobFailedMessage)
Set the message that is logged when a Job fails its execution. |
void |
setJobSuccessMessage(String jobSuccessMessage)
Set the message that is logged when a Job successfully completes its execution. |
void |
setJobToBeFiredMessage(String jobToBeFiredMessage)
Set the message that is logged when a Job is about to execute. |
void |
setJobWasVetoedMessage(String jobWasVetoedMessage)
Set the message that is logged when a Job execution is vetoed by a trigger listener. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
LoggingJobHistoryPlugin
public LoggingJobHistoryPlugin()
Method Detail |
---|
getLog
protected org.slf4j.Logger getLog()
getJobSuccessMessage
public String getJobSuccessMessage()
- Get the message that is logged when a Job successfully completes its
execution.
getJobFailedMessage
public String getJobFailedMessage()
- Get the message that is logged when a Job fails its
execution.
getJobToBeFiredMessage
public String getJobToBeFiredMessage()
- Get the message that is logged when a Job is about to execute.
setJobSuccessMessage
public void setJobSuccessMessage(String jobSuccessMessage)
- Set the message that is logged when a Job successfully completes its
execution.
- Parameters:
jobSuccessMessage
- String in java.text.MessageFormat syntax.
setJobFailedMessage
public void setJobFailedMessage(String jobFailedMessage)
- Set the message that is logged when a Job fails its
execution.
- Parameters:
jobFailedMessage
- String in java.text.MessageFormat syntax.
setJobToBeFiredMessage
public void setJobToBeFiredMessage(String jobToBeFiredMessage)
- Set the message that is logged when a Job is about to execute.
- Parameters:
jobToBeFiredMessage
- String in java.text.MessageFormat syntax.
getJobWasVetoedMessage
public String getJobWasVetoedMessage()
- Get the message that is logged when a Job execution is vetoed by a
trigger listener.
setJobWasVetoedMessage
public void setJobWasVetoedMessage(String jobWasVetoedMessage)
- Set the message that is logged when a Job execution is vetoed by a
trigger listener.
- Parameters:
jobWasVetoedMessage
- String in java.text.MessageFormat syntax.
initialize
public void initialize(String name, Scheduler scheduler) throws SchedulerException
Called during creation of the
Scheduler
in order to give theSchedulerPlugin
a chance to initialize.- Specified by:
initialize
in interfaceorg.quartz.spi.SchedulerPlugin
- Throws:
SchedulerConfigException
- if there is an error initializing.SchedulerException
start
public void start()
- Specified by:
start
in interfaceorg.quartz.spi.SchedulerPlugin
shutdown
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.- Specified by:
shutdown
in interfaceorg.quartz.spi.SchedulerPlugin
getName
public String getName()
- Description copied from interface:
JobListener
Get the name of the
JobListener
.- Specified by:
getName
in interfaceJobListener
jobToBeExecuted
public void jobToBeExecuted(JobExecutionContext context)
- Description copied from interface:
JobListener
Called by the
Scheduler
when aJobDetail
is about to be executed (an associatedTrigger
has occurred).This method will not be invoked if the execution of the Job was vetoed by a
TriggerListener
.- Specified by:
jobToBeExecuted
in interfaceJobListener
jobWasExecuted
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
- Description copied from interface:
JobListener
Called by the
Scheduler
after aJobDetail
has been executed, and be for the associatedTrigger
'striggered(xx)
method has been called.- Specified by:
jobWasExecuted
in interfaceJobListener
jobExecutionVetoed
public void jobExecutionVetoed(JobExecutionContext context)
- Description copied from interface:
JobListener
Called by the
Scheduler
when aJobDetail
was about to be executed (an associatedTrigger
has occurred), but aTriggerListener
vetoed it's execution.- Specified by:
jobExecutionVetoed
in interfaceJobListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2001-2011, Terracotta, Inc.