日常开发来说,相对于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功能对比的更多相关文章

  1. PDF Transformer+与Transformer3.0功能对比

    ABBYY PDF Transformer+是一个新的.全面的巧妙解决PDF文档的工具,它将泰比的光学字符识别(OCR)技术和Adobe®PDF技术完美结合,以确保实现便捷地处理任何类型的PDF文件, ...

  2. .net Mongo Driver 1.0与2.0的对比与2.0的优化

    前言 最近闲的时间有点多,所以还是写博客吧. 有人说Mongo 2.0的写法难以把控,好多地方不知道咋用,所以坚持用1.0(不愿意去尝试2.0),我感觉不可理解.所以写篇博客比较下. Mongo C# ...

  3. 微信公众号php从0开发,包括功能(自定义菜单,分享)

    之前写的一篇微信公众号文章. 工作需要,进行此次调研,并记录开发过程. 开发目的,页面授权,页面获取用户头像,用户昵称 微信id, 分享页面. 微信订阅号 无法获取用户个人信息 写在记录前,公众号也是 ...

  4. .NET Framework3.0/3.5/4.0/4.5新增功能摘要

    Microsoft .NET Framework 3.0 .NET Framework 3.0 中增加了不少新功能,例如: Windows Workflow Foundation (WF) Windo ...

  5. 可在广域网部署运行的QQ高仿版 -- GG叽叽V3.0,完善基础功能(源码)

    (前段时间封闭式开发完了一个项目,最近才有时间继续更新GG的后续版本,对那些关注GG的朋友来说,真的是很抱歉.)GG的前面几个版本开发了一些比较高级的功能,像视频聊天.远程桌面.文件传送.远程磁盘等, ...

  6. .Net框架2.0和4.0版本对比

    .Net版本 2.0 SP2 4.0 操作系统 Windows 2000 SP4以上 Windows XP SP3以上 安装包大小 NetFx20SP2_x86.exe 23.8 MBNetFx20S ...

  7. Eviews 8.0&9.0界面新功能介绍

    Eviews 8.0&9.0界面新功能介绍 本文其中一些是自己的整理,也有一些是经管之家论坛中一位热心.好学坛友的整理,其中只是简单介绍一下这两个新版本的部分特性,分享出来,有兴趣的看客可以一 ...

  8. 生鲜配送管理系统_升鲜宝V2.0 小标签打印功能说明_15382353715

    小标签打印说明 小标签打印可以打印本系统的订单商品数量,也可以把外部的订单商品导入本系统进行打印. 打印本系统中的订单商品操作说明 1.1    界面说明 1.2     查询条件 1.2.1     ...

  9. SpringBoot2.0小程序支付功能实现weixin-java-pay

    SpringBoot2.0小程序支付功能实现weixin-java-pay WxJava - 微信开发 Java SDK(开发工具包); 支持包括微信支付.开放平台.公众号.企业微信/企业号.小程序等 ...

  10. MySQL 8.0有什么新功能

    https://mysqlserverteam.com/whats-new-in-mysql-8-0-generally-available/ 我们自豪地宣布MySQL 8.0的一般可用性. 现在下载 ...

随机推荐

  1. 常用SQL函数(字符串分隔转表、自增长转编号)

    字符串分隔转表 -- ============================================= -- Author: -- Create date: -- Description: ...

  2. 搜索引擎ElasticSearchV5.4.2系列三之ES使用

    相关博文: 搜索引擎ElasticSearchV5.4.2系列一之ES介绍 搜索引擎ElasticSearchV5.4.2系列二之ElasticSearchV5.4.2+kibanaV5.4.2+x- ...

  3. Docker手动搭建sentry错误日志系统

    Sentry介绍 在开发过程中,我们通过debug来排查bug,并且使用logging来记录系统的错误.但是logging有很多不足: 必须登陆到服务器查看日志文件 需要主动去查询 输出日志方式无法把 ...

  4. Chrome插件 postman的使用方法详解!最全面的教程

    一 简介 Postman 是一款功能超级强大的用于发送 HTTP 请求的 Chrome插件 .做web页面开发和测试的人员应该是无人不晓无人不用!其主要特点 特点: 创建 + 测试:创建和发送任何的H ...

  5. pyhton之os.path

    目录结构 file __file__表示了当前文件的path 以相对路径运行:python 1.py 结果:1.py 以绝对路径运行:python F:\python-study\test\1.py ...

  6. eclipse开发mapreduce程序时出现的问题

    1.报HDFS权限不够:org.apache.hadoop.security.AccessControlException: Permission denied:user=ouqiping, acce ...

  7. 2.选择元素 - 自定义过滤器《jquery实战》

    2.5.6 自定义过滤器 jQuery 中有两种方法创建自定义的过滤器.第一种比较简单,但是不鼓励,从 jQuery 1.8 开始已经被第二种方法取代.记住,使用新方法时,你自定义的过滤器在 jQue ...

  8. PHP 5.2、5.3、5.4、5.5、5.6 对比以及功能详解

    php5.2.x php5.3.x php5.4.x php5.5.x php5.6.x 对比详解 截至目前(2014.2), PHP 的最新稳定版本是 PHP5.5, 但有差不多一半的用户仍在使用已 ...

  9. Class PropertyPlaceholderHelper的使用

    1.代码 private static Properties properties = new Properties(); public static String getProperties(Str ...

  10. 036 SQLContext和HiveContext

    1.SqlContext SQLContext依赖SparkContext 功能:支持SparkSQL操作(不依赖Hive) SQLContext在一个JVM中默认允许存在多个 只有SQLContex ...