public class XMLSchedulingDataProcessorPlugin extends SchedulerPluginWithUserTransactionSupport implements FileScanListener
The XML schema definition can be found here: http://www.quartz-scheduler.org/xml/job_scheduling_data_2_0.xsd
The periodically scanning of files for changes is not currently supported in a clustered environment.
If using this plugin with JobStoreCMT, be sure to set the plugin property wrapInUserTransaction to true. Also, if you have a positive scanInterval be sure to set org.quartz.scheduler.wrapJobExecutionInUserTransaction to true.
XMLSchedulingDataProcessor| Modifier and Type | Field and Description |
|---|---|
protected ClassLoadHelper |
classLoadHelper |
| Constructor and Description |
|---|
XMLSchedulingDataProcessorPlugin() |
| Modifier and Type | Method and Description |
|---|---|
void |
fileUpdated(String fileName) |
String |
getFileNames()
Comma separated list of file names (with paths) to the XML files that should be read.
|
long |
getScanInterval()
The interval (in seconds) at which to scan for changes to the file.
|
void |
initialize(String name,
Scheduler scheduler,
ClassLoadHelper schedulerFactoryClassLoadHelper)
Called during creation of the
Scheduler in order to give
the SchedulerPlugin a chance to initialize. |
boolean |
isFailOnFileNotFound()
Whether or not initialization of the plugin should fail (throw an
exception) if the file cannot be found.
|
void |
processFile(String filePath) |
void |
setFailOnFileNotFound(boolean failOnFileNotFound)
Whether or not initialization of the plugin should fail (throw an
exception) if the file cannot be found.
|
void |
setFileNames(String fileNames)
The file name (and path) to the XML file that should be read.
|
void |
setScanInterval(long scanInterval)
The interval (in seconds) at which to scan for changes to the file.
|
void |
shutdown()
Overriden to ignore wrapInUserTransaction because shutdown()
does not interact with the
Scheduler. |
void |
start(UserTransaction userTransaction)
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. |
getLog, getName, getScheduler, getWrapInUserTransaction, initialize, setWrapInUserTransaction, shutdown, startprotected ClassLoadHelper classLoadHelper
public String getFileNames()
public void setFileNames(String fileNames)
public long getScanInterval()
public void setScanInterval(long scanInterval)
scanInterval - The scanInterval to set.public boolean isFailOnFileNotFound()
true.public void setFailOnFileNotFound(boolean failOnFileNotFound)
true.public void initialize(String name, Scheduler scheduler, ClassLoadHelper schedulerFactoryClassLoadHelper) throws SchedulerException
Called during creation of the Scheduler in order to give
the SchedulerPlugin a chance to initialize.
initialize in interface SchedulerPluginname - The name by which the plugin is identified.scheduler - The scheduler to which the plugin is registered.schedulerFactoryClassLoadHelper - The classLoadHelper the SchedulerFactory is
actually usingSchedulerConfigException - if there is an error initializing.SchedulerExceptionpublic void start(UserTransaction userTransaction)
SchedulerPluginWithUserTransactionSupport
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.
If UserTransaction is not null, the plugin can call setRollbackOnly() on it to signal that the wrapped transaction should rollback.
start in class SchedulerPluginWithUserTransactionSupportuserTransaction - The UserTranaction object used to provide a
transaction around the start() operation. It will be null if
wrapInUserTransaction is false or if the transaction failed
to be started.public void shutdown()
Scheduler.shutdown in interface SchedulerPluginshutdown in class SchedulerPluginWithUserTransactionSupportpublic void processFile(String filePath)
public void fileUpdated(String fileName)
fileUpdated in interface FileScanListenerFileScanListener.fileUpdated(java.lang.String)Copyright 2001-2019, Terracotta, Inc.