quartz 2.0 与1.0功能对比
日常开发来说,相对于1.0版,2.0版在使用上有以下几点需要注意的变化
变化一 比1.0多引用了C5.dll
- C5.dll 一个C#和其他CLI语言的泛型集合类。.Net2.0及以上才可以使用。简介地址:http://www.itu.dk/research/c5/
变化二 quartz.config有细微变化
- quartz.plugin.xml.type由1.x的Quartz.Plugin.Xml.JobInitializationPlugin, Quartz变为了2.0中的Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz
- 2.0版本新增了一行配置quartz.scheduler.exporter.channelName = httpQuart
- 1.0 quartz.config

1 # You can configure your scheduler in either <quartz> configuration section
2 # or in quartz properties file
3 # Configuration section has precedence
4
5 quartz.scheduler.instanceName = ServerScheduler
6
7 # configure thread pool info
8 quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
9 quartz.threadPool.threadCount = 10
10 quartz.threadPool.threadPriority = Normal
11
12 # job initialization plugin handles our xml reading, without it defaults are used -->
13 quartz.plugin.xml.type = Quartz.Plugin.Xml.JobInitializationPlugin, Quartz
14 quartz.plugin.xml.fileNames = ~/quartz_jobs.xml
15
16 # export this server to remoting context
17 quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
18 quartz.scheduler.exporter.port = 555
19 quartz.scheduler.exporter.bindName = QuartzScheduler
20 quartz.scheduler.exporter.channelType = tcp
- 2.0 quartz.config

1 # You can configure your scheduler in either <quartz> configuration section
2 # or in quartz properties file
3 # Configuration section has precedence
4
5 quartz.scheduler.instanceName = ServerScheduler
6
7 # configure thread pool info
8 quartz.threadPool.type = Quartz.Simpl.SimpleThreadPool, Quartz
9 quartz.threadPool.threadCount = 10
10 quartz.threadPool.threadPriority = Normal
11
12 # job initialization plugin handles our xml reading, without it defaults are used
13 quartz.plugin.xml.type = Quartz.Plugin.Xml.XMLSchedulingDataProcessorPlugin, Quartz
14 quartz.plugin.xml.fileNames = ~/quartz_jobs.xml
15
16 # export this server to remoting context
17 quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz
18 quartz.scheduler.exporter.port = 555
19 quartz.scheduler.exporter.bindName = QuartzScheduler
20 quartz.scheduler.exporter.channelType = tcp
21 quartz.scheduler.exporter.channelName = httpQuartz
变化三 实现IJob接口 JobExecutionContext对象变成了IJobExecutionContext
- 1.0 IJob接口

public class SimpleJob : IJob
{
#region IJob 成员 public void Execute(JobExecutionContext context)
{
throw new NotImplementedException();
} #endregion
}
- 2.0 IJob接口

public class SimpleJob : IJob
{
#region IJob 成员 public void Execute(IJobExecutionContext context)
{
throw new NotImplementedException();
} #endregion
}
变化四 quartz_jobs.xml配置节发生了变化
- 根结点有<quartz>变为了<job-scheduling-data>
- 新增了<schedule>节点,<job>均放在<schedule>节点下,删除了 <job-detail>节点,同时删除了<volatile>false</volatile>属性
- <trigger>不在放置在<job>下面,改为和<job>平行
- 1.0 quartz_jobs.xml示例

1 <?xml version="1.0" encoding="UTF-8"?>
2 <quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" overwrite-existing-jobs="true">
3
4 <job>
5 <job-detail>
6 <name>sampleJob</name>
7 <group>sampleGroup</group>
8 <description>Sample job for Quartz Server</description>
9 <job-type>Quartz.Job.NoOpJob, Quartz</job-type>
10 <volatile>false</volatile>
11 <durable>true</durable>
12 <recover>false</recover>
13 </job-detail>
14 <trigger>
15 <simple>
16 <name>sampleSimpleTrigger</name>
17 <group>sampleSimpleGroup</group>
18 <description>Simple trigger to simply fire sample job</description>
19 <misfire-instruction>SmartPolicy</misfire-instruction>
20 <volatile>false</volatile>
21 <job-name>sampleJob</job-name>
22 <job-group>sampleGroup</job-group>
23 <repeat-count>RepeatIndefinitely</repeat-count>
24 <repeat-interval>3000</repeat-interval>
25 </simple>
26 </trigger>
27 </job>
28
29 <job>
30 <job-detail>
31 <name>sampleJob2</name>
32 <group>sampleGroup2</group>
33 <description>Sample job for Quartz Server</description>
34 <job-type>Quartz.Job.NoOpJob, Quartz</job-type>
35 <volatile>false</volatile>
36 <durable>true</durable>
37 <recover>false</recover>
38 </job-detail>
39 <trigger>
40 <cron>
41 <name>sampleSimpleTrigger2</name>
42 <group>sampleSimpleTrigger2</group>
43 <job-name>sampleJob2</job-name>
44 <job-group>sampleGroup2</job-group>
45 <cron-expression>0/10 * * * * ?</cron-expression>
46 </cron>
47 </trigger>
48 </job>
49 </quartz>
- 2.0 quartz_jobs.xml示例

<?xml version="1.0" encoding="UTF-8"?> <!-- This file contains job definitions in schema version 2.0 format --> <job-scheduling-data xmlns="http://quartznet.sourceforge.net/JobSchedulingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0"> <processing-directives>
<overwrite-existing-data>true</overwrite-existing-data>
</processing-directives> <schedule> <job>
<name>sampleJob</name>
<group>sampleGroup</group>
<description>Sample job for Quartz Server</description>
<job-type>Quartz.Server.SampleJob, Quartz.Server</job-type>
<durable>true</durable>
<recover>false</recover>
</job>
<trigger>
<simple>
<name>sampleSimpleTrigger</name>
<group>sampleSimpleGroup</group>
<description>Simple trigger to simply fire sample job</description>
<job-name>sampleJob</job-name>
<job-group>sampleGroup</job-group>
<misfire-instruction>SmartPolicy</misfire-instruction>
<repeat-count>-1</repeat-count>
<repeat-interval>10000</repeat-interval>
</simple>
</trigger> <job>
<name>CommissionJob</name>
<group>CommissionJob</group>
<description>Sample job for Quartz Server</description>
<job-type>Settlement.Jobs.CommissionJob, Settlement.Jobs</job-type>
<durable>true</durable>
<recover>false</recover>
</job>
<trigger>
<cron>
<name>sampleSimpleTrigger2</name>
<group>sampleSimpleTrigger2</group>
<job-name>sampleJob2</job-name>
<job-group>sampleGroup2</job-group>
<cron-expression>0/10 * * * * ?</cron-expression>
</cron>
</trigger>
</schedule>
</job-scheduling-data>
变化五 支持.Net版本不同
- Quartz 1.0可以支持.Net 1.1 和 .Net 2.0及以上版本
- Quartz 2.0仅支持.Net 3.5及以上版本,放弃了对.Net 1.1和.Net 2.0的支持
quartz 2.0 与1.0功能对比的更多相关文章
- PDF Transformer+与Transformer3.0功能对比
ABBYY PDF Transformer+是一个新的.全面的巧妙解决PDF文档的工具,它将泰比的光学字符识别(OCR)技术和Adobe®PDF技术完美结合,以确保实现便捷地处理任何类型的PDF文件, ...
- .net Mongo Driver 1.0与2.0的对比与2.0的优化
前言 最近闲的时间有点多,所以还是写博客吧. 有人说Mongo 2.0的写法难以把控,好多地方不知道咋用,所以坚持用1.0(不愿意去尝试2.0),我感觉不可理解.所以写篇博客比较下. Mongo C# ...
- 微信公众号php从0开发,包括功能(自定义菜单,分享)
之前写的一篇微信公众号文章. 工作需要,进行此次调研,并记录开发过程. 开发目的,页面授权,页面获取用户头像,用户昵称 微信id, 分享页面. 微信订阅号 无法获取用户个人信息 写在记录前,公众号也是 ...
- .NET Framework3.0/3.5/4.0/4.5新增功能摘要
Microsoft .NET Framework 3.0 .NET Framework 3.0 中增加了不少新功能,例如: Windows Workflow Foundation (WF) Windo ...
- 可在广域网部署运行的QQ高仿版 -- GG叽叽V3.0,完善基础功能(源码)
(前段时间封闭式开发完了一个项目,最近才有时间继续更新GG的后续版本,对那些关注GG的朋友来说,真的是很抱歉.)GG的前面几个版本开发了一些比较高级的功能,像视频聊天.远程桌面.文件传送.远程磁盘等, ...
- .Net框架2.0和4.0版本对比
.Net版本 2.0 SP2 4.0 操作系统 Windows 2000 SP4以上 Windows XP SP3以上 安装包大小 NetFx20SP2_x86.exe 23.8 MBNetFx20S ...
- Eviews 8.0&9.0界面新功能介绍
Eviews 8.0&9.0界面新功能介绍 本文其中一些是自己的整理,也有一些是经管之家论坛中一位热心.好学坛友的整理,其中只是简单介绍一下这两个新版本的部分特性,分享出来,有兴趣的看客可以一 ...
- 生鲜配送管理系统_升鲜宝V2.0 小标签打印功能说明_15382353715
小标签打印说明 小标签打印可以打印本系统的订单商品数量,也可以把外部的订单商品导入本系统进行打印. 打印本系统中的订单商品操作说明 1.1 界面说明 1.2 查询条件 1.2.1 ...
- SpringBoot2.0小程序支付功能实现weixin-java-pay
SpringBoot2.0小程序支付功能实现weixin-java-pay WxJava - 微信开发 Java SDK(开发工具包); 支持包括微信支付.开放平台.公众号.企业微信/企业号.小程序等 ...
- MySQL 8.0有什么新功能
https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ 我们自豪地宣布MySQL 8.0的一般可用性. 现在下载 ...
随机推荐
- Apache+jboss群集优化
故障现象: 俩台服务器jboss做的Apache群集,之前优先访问A,造成大量session都在A上有报警. 调整 调整Apache 配置jboss集群参数,将Node2的worker.node2.l ...
- 【转】深入理解C++中public、protected及private用法
首先明白以下两点: 1.类的一个特征就是封装,public和private作用就是实现这一目的. 即:用户代码(类外)可以访问public成员而不能访问private成员:private成员只能由类成 ...
- 关于iTerm2中颜色配置及快捷键使用技巧(亲测)
https://github.com/mbadolato/iTerm2-Color-Schemes http://chriskempson.com/projects/base16 (同事用的) 按照g ...
- ps自由变换以及再次变换快捷键
ctrl+t:自由变换ctrl+shift+t:再次变换ctrl+shift+alt+t:复制一次,再次变换.
- python 列表元组加减乘除法
元组(typle)列表(list)没有减法和除法,但有加法和乘法. 1.加法,即把元素相加.只可以list和tuple相加,不能加其他类型. t= (1, ) + (2, 3, 4) print(t, ...
- nginx前后端分离路由配置
参考链接: https://blog.csdn.net/qq_30021219/article/details/80901199
- 交换机NTP的MD5配置
1.ntp-service authentication enable 开启NTP身份验证功能 2.ntp-service source-interfer LoopBack0 指定本机发生NTP的端 ...
- 5 个 Laravel Eloquent 小技巧
1. 快速生成 Model & Migration 这并不是一个很多人知道的小技巧,为文章生成 Model 和 Migration. $ php artisan make:migration ...
- SqlServerDBCC SHRINKFILE不起作用
检查索引碎片的结果: CREATE DATABASE test_shrink USE test_shrink CREATE TABLE show_extent(a INT,b NVARCHAR(390 ...
- 前端Datatables自定义事件(监听Datatables插件一些常见的事件动作)
今天开发项目的时候,用Datatables插件做前端分页列表,想在列表发生翻页.排序.搜索.改变单页显示数据条数这些行为的时候做一些其他的操作,看了半天Datatables官网终于找到可以监测到这些事 ...