|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.quartz.plugins.history.LoggingJobHistoryPlugin
public class LoggingJobHistoryPlugin
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. |
Constructor Summary | |
---|---|
LoggingJobHistoryPlugin()
|
Method Summary | |
---|---|
java.lang.String |
getJobFailedMessage()
Get the message that is logged when a Job fails its execution. |
java.lang.String |
getJobSuccessMessage()
Get the message that is logged when a Job successfully completes its execution. |
java.lang.String |
getJobToBeFiredMessage()
Get the message that is logged when a Job is about to execute. |
java.lang.String |
getJobWasVetoedMessage()
Get the message that is logged when a Job execution is vetoed by a trigger listener. |
protected org.slf4j.Logger |
getLog()
|
java.lang.String |
getName()
Get the name of the JobListener . |
void |
initialize(java.lang.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 when a
was about to be executed (an associated
has occurred), but a vetoed it's
execution. |
void |
jobToBeExecuted(JobExecutionContext context)
Called by the when a
is about to be executed (an associated
has occurred). |
void |
jobWasExecuted(JobExecutionContext context,
JobExecutionException jobException)
Called by the after a
has been executed, and be for the associated Trigger 's
triggered(xx) method has been called. |
void |
setJobFailedMessage(java.lang.String jobFailedMessage)
Set the message that is logged when a Job fails its execution. |
void |
setJobSuccessMessage(java.lang.String jobSuccessMessage)
Set the message that is logged when a Job successfully completes its execution. |
void |
setJobToBeFiredMessage(java.lang.String jobToBeFiredMessage)
Set the message that is logged when a Job is about to execute. |
void |
setJobWasVetoedMessage(java.lang.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()
Called when the associated Scheduler is started, in order
to let the plug-in know it can now make calls into the scheduler if it
needs to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LoggingJobHistoryPlugin()
Method Detail |
---|
protected org.slf4j.Logger getLog()
public java.lang.String getJobSuccessMessage()
public java.lang.String getJobFailedMessage()
public java.lang.String getJobToBeFiredMessage()
public void setJobSuccessMessage(java.lang.String jobSuccessMessage)
jobSuccessMessage
- String in java.text.MessageFormat syntax.public void setJobFailedMessage(java.lang.String jobFailedMessage)
jobFailedMessage
- String in java.text.MessageFormat syntax.public void setJobToBeFiredMessage(java.lang.String jobToBeFiredMessage)
jobToBeFiredMessage
- String in java.text.MessageFormat syntax.public java.lang.String getJobWasVetoedMessage()
public void setJobWasVetoedMessage(java.lang.String jobWasVetoedMessage)
jobWasVetoedMessage
- String in java.text.MessageFormat syntax.public void initialize(java.lang.String name, Scheduler scheduler) throws SchedulerException
Called during creation of the Scheduler
in order to give
the SchedulerPlugin
a chance to initialize.
initialize
in interface SchedulerPlugin
name
- The name by which the plugin is identified.scheduler
- The scheduler to which the plugin is registered.
SchedulerConfigException
- if there is an error initializing.
SchedulerConfigException
- if there is an error initializing.
SchedulerException
public void start()
SchedulerPlugin
Called when the associated Scheduler
is started, in order
to let the plug-in know it can now make calls into the scheduler if it
needs to.
start
in interface SchedulerPlugin
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.
shutdown
in interface SchedulerPlugin
public java.lang.String getName()
JobListener
Get the name of the JobListener
.
getName
in interface JobListener
public void jobToBeExecuted(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
is about to be executed (an associated JobDetail
has occurred).
Trigger
This method will not be invoked if the execution of the Job was vetoed
by a
.
TriggerListener
jobToBeExecuted
in interface JobListener
JobListener.jobToBeExecuted(JobExecutionContext)
public void jobWasExecuted(JobExecutionContext context, JobExecutionException jobException)
JobListener
Called by the
after a Scheduler
has been executed, and be for the associated JobDetail
Trigger
's
triggered(xx)
method has been called.
jobWasExecuted
in interface JobListener
JobListener.jobWasExecuted(JobExecutionContext, JobExecutionException)
public void jobExecutionVetoed(JobExecutionContext context)
JobListener
Called by the
when a Scheduler
was about to be executed (an associated JobDetail
has occurred), but a Trigger
vetoed it's
execution.
TriggerListener
jobExecutionVetoed
in interface JobListener
JobListener.jobExecutionVetoed(org.quartz.JobExecutionContext)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |