Getting Started with XML - Using XML. The schedule .author: meanson wangemail: meansonw@hotmail.comdate: 2004-12-12section 01: Why quartzquartz is an enterprise-class schedule [Schedule] software, there are familiar cron definitions under UNIX, Simple definition method. Quartz's storage mode can be a memory storage or a database can be used to achieve persistence. Section 02: Why this article This article is found in the process of starting with Quartz, watching Quartz's document is a painful thing, because you want to cross the staddy in the afternoon, it finds that it even has no Quick Start, except depressed Don't have no way. This article is a practical style, directly introduces how you can use Quartz, at least, replace Timer.SECTION 03: How to start ... This article describes how to start Quartz tasks with XML. 1. Download Quartz to put Quartz inside yourappl / Web-Inf / Lib. 2. Configure web.xml to start the Quartz service. Add the following in Yourrappl / Web-INF / Web.xml.
XML Version = "1.0" Encoding = "UTF-8"?>
## Configure threadpool #
Org.quartz.threadpool.class = org.quartz.simpla.SIMPLETHREADPOOLORG.QUARTZ.THREADPOOL.THREADPOOL.THREADPRIRITY = 4 ## Configure jobstore #
Org.quartz.jobstore.MisfirethReshold = 5000
Org.quartz.jobstore.class = org.quartz.simpl.ramjobstore
# ===================================================== ========================== # configure schedulerplugins ===================== ========================== # ==================================================================================================================================================================================== ============================================================================================================================================================================================================= .. == org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPluginorg.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} with resulting trigger instruction code: {9}
org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPluginorg.quartz.plugin.jobInitializer.fileName = /quartz_reminder.xmlorg.quartz.plugin.jobInitializer.overWriteExistingJobs = falseorg.quartz.plugin.jobInitializer.failOnFileNotFound = Trueorg.quartz.plugin.shutdownhook.class = org.quartz.plugins.Management.shutdownhookPluginorg.quartz.plugin.shutdownhook.cleanshutdown = true
Ok, now you will find a JSP server, pay attention to the output of logs, you can test your schedule. Postscript: 2004-12-20quartz uses the following file header: It analyzes the XML file with the DTD file. This is not a problem, the problem is, this DTD file is placed on the Quartz website, if your server can't access the Internet, your quartz can't work properly. Solution: 1. Copy the DTD folder of the DOCS in Quartz1.4.2.zip to your application yourappl. 2. Modify the file header of the XML file: 3. Enter the absolute path is also possible, such as" / Tomcat/yourappl/dtd/job_scheduling_data_1_0.dtd "
Attached: CRONEXPRESSION configuration instructions
Special characters allowed by field allow for special characters to be allowed by 0-59, - * / 分 0-59, - * / hour 0-23, - * / Date 1-31, - *? / LWC month 1-12 or Jan-Dec, - * / Week 1-7 or Sun-sat, - *? / Lc # years (optional) Leaves the blank, 1970-2099, - * /