Quartz Scheduler Configuration Guide : Plugin Configuration
Plugin Configuration
Like listeners, configuring plugins through the configuration file consists of giving then a name, and then specifying the class name, and any other properties to be set on the instance. The class must have a no-arg constructor, and the properties are set reflectively. Only primitive data type values (including Strings) are supported.
The general pattern for defining a plug-in is:
org.quartz.plugin.NAME.class = com.foo.MyPluginClass
org.quartz.plugin.NAME.propName = propValue
org.quartz.plugin.NAME.prop2Name = prop2Value
There are several Plugins that come with Quartz, that can be found in the org.quartz.plugins package (and subpackages). Examples of configuring a few of them are shown in the topics that follow.
Sample configuration of Logging Trigger History Plugin
The Logging Trigger History plugin catches trigger events (it is also a trigger listener) and logs them with Jakarta Commons-Logging. See the class’s Javadoc for a list of all the possible parameters.
org.quartz.plugin.triggHistory.class = \
org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = \
Trigger \{1\}.\{0\} fired job \{6\}.\{5\} at: \{4, date, HH:mm:ss MM/dd/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = \
Trigger \{1\}.\{0\} completed firing job \{6\}.\{5\} at \{4, date, HH:mm:ss MM/dd/yyyy\}.
Sample configuration of XML Scheduling Data Processor Plugin
Job initialization plugin reads a set of jobs and triggers from an XML file, and adds them to the scheduler during initialization. It can also delete existing data. See the class’s Javadoc for more details.
org.quartz.plugin.jobInitializer.class = \
org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.fileNames = \
data/my_job_data.xml
org.quartz.plugin.jobInitializer.failOnFileNotFound =
true
The XML schema definition for the file can be found here:
http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd
Sample configuration of Shutdown Hook Plugin
The shutdown-hook plugin catches the event of the JVM terminating, and calls shutdown on the scheduler.
org.quartz.plugin.shutdownhook.class = \
org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true
Copyright © 2010-2015 Software AG, Darmstadt, Germany.

Product Logo |   Feedback