11
Im做與Quartz.Net 一個相當簡單的調度任務概念的證明,我唯一的要求是,它不需要重新配置石英服務重新啓動配置文件更改時,quartz.net可以重新配置作業嗎?
這是測試代碼
var factory = new StdSchedulerFactory();
var scheduler = factory.GetScheduler();
scheduler.Start();
在app.config中
<quartz>
<add key="quartz.scheduler.instanceName" value="QuartzScheduler" />
<!-- Configure Thread Pool -->
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="10" />
<add key="quartz.threadPool.threadPriority" value="Normal" />
<!-- Configure Job Store -->
<add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
<add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.JobInitializationPlugin, Quartz" />
<add key="quartz.plugin.xml.fileNames" value="quartz.config" />
我的工作配置
相關數據文件
<?xml version="1.0" encoding="UTF-8"?>
<quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="1.0"
overwrite-existing-jobs="true">
<job>
<job-detail>
<name>jobName1</name>
<group>jobGroup1</group>
<description>jobDesciption1</description>
<job-type>Jobs.MyJob, Jobs</job-type>
<volatile>false</volatile>
<durable>true</durable>
<recover>false</recover>
</job-detail>
<trigger>
<cron>
<name>cronName1</name>
<group>cronGroup1</group>
<description>CronTriggerDescription</description>
<job-name>jobName1</job-name>
<job-group>jobGroup1</job-group>
<cron-expression>0 0/1 * * * ?</cron-expression>
</cron>
</trigger>
</job>
</quartz>
cron表達式工作和每分鐘執行一次,但如果我將表達式更改爲0 0/5 * * *?在運行服務時,它仍然每分鐘都會觸發。那麼是否有辦法配置Quartz.net以便它監聽配置文件的文件更改?
謝謝,哪個插件? – Anders 2011-02-03 12:18:27