- 浏览: 184521 次
-
最新评论
-
adamed:
zhangwenzhuo 写道为什么this.get()会返回 ...
jQuery源码历代记5 -
zhangwenzhuo:
为什么this.get()会返回本身的呢?
jQuery源码历代记5 -
narutolby:
支持下~,哈哈~
jQuery历代记1 -
cpszy:
mark下
jQuery历代记1 -
gleams:
支持你
jQuery历代记1
You can have as many properties as you need to configure your plug-in.
你可以用多个属性配置插件。
<o:p> </o:p>
The Quartz framework converts the property values to the type specified in the plug-in, assuming that it's a primitive type. For example, you can specify properties of type int and expect Quartz to convert the String from the quartz.properties file to an int. The framework, however, will not convert 1 to an integer class.
<o:p> </o:p>
Quartz会将属性值转换为插件中定义的类型,假定该类型是基本数据类型。例如你可以指定参数为int,Quartz会将quartz.properties中的字符串转换为int值。然而框架不会将1转换为Integer类。
<o:p> </o:p>
Creating the Job File for the JobLoaderPlugin<o:p></o:p>
创建JobLoaderPlugin使用的Job文件<o:p></o:p>
<o:p> </o:p>
The JobLoaderPlugin looks for all XML files in the specified directory and assumes that each file is a valid Quartz jobs file. By "valid," we mean that the XML file adheres to the latest job-scheduling XSD file, which at the time of this writing is job_scheduling_data_1_5.xsd.
<o:p> </o:p>
JobLoaderPlugin在指定的文件夹中查找所有的XML文件并假定这些文件都是合法的Quartz job定义文件。所谓“合法”值XML遵循最新的作业调度XSD文件。在本书编写时最新的版本是job_scheduling_data_1_5.xsd。
<o:p> </o:p>
To make the JobLoaderPlugin more useful, we put each job, along with its job detail and trigger information, in a single XML file. This enables us to add and remove complete jobs just by putting the file into the directory or taking it out. This is very helpful in a development environment when you want to test only certain jobs. A single job XML file is shown in Listing 8.4.
<o:p> </o:p>
为了让JobLoaderPlugin更加有用,我们将每个job与它的job detail、触发器信息单独作为一个XML文件。这使得我们添加移除整个job时候只需要将文件添加或移出文件夹。在开发环境中如果我们需要测试某个单独的job的时候这是非常有帮助的。一个单独的job XML文件如列表8.4。
<o:p> </o:p>
Listing 8.4. A Job XML File Read by the JobLoaderPlugin<o:p></o:p>
列表8.4 供JobLoaderPlugin读取的一个Job XML文件
- <?xml version='1.0' encoding='utf-8'?>
- <quartz xmlns="http://www.opensymphony.com/quartz/JobSchedulingData"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.opensymphony.com/quartz/JobSchedulingData
- http://www.opensymphony.com/quartz/xml/job_scheduling_data_1_5.xsd"
- version="1.5">
- <job>
- <job-detail>
- <name>PrintInfoJob1</name>
- <group>DEFAULT</group>
- <job-class>
- org.cavaness.quartzbook.chapter3.ScanDirectoryJob
- </job-class>
- <volatility>false</volatility>
- <durability>false</durability>
- <recover>false</recover>
- <job-data-map allows-transient-data="true">
- <entry>
- <key>SCAN_DIR</key>
- <value>c:\quartz-book\input1</value>
- </entry>
- </job-data-map>
- </job-detail>
- <trigger>
- <simple>
- <name>trigger1</name>
- <group>DEFAULT</group>
- <job-name>PrintInfoJob1</job-name>
- <job-group>DEFAULT</job-group>
- <start-time>2005-07-30T16:04:00</start-time>
- <!-- repeat indefinitely every 10 seconds -->
- <repeat-count>-1</repeat-count>
- <repeat-interval>10000</repeat-interval>
- </simple>
- </trigger>
- </job>
- </quartz>
The job file is Listing 8.4 contains all the information necessary for the JobLoaderPlugin to schedule the job. This file also contains an entry for the JobDataMap, which is available to the job class at runtime. The example in Listing 8.4 uses a configured SimpleTrigger to schedule an infinitely repeating trigger that fires every 10 seconds. To further test the plug-in, we created a second job file, which differs from the first in some small way. Listing 8.5 shows the second job file.
<o:p> </o:p>
列表8.4显示的job文件包含所有的供JobLoaderPlugin调度job所需要的信息。这个文件还包含一个可以在类中实时供JobDataMap调用的实体。列表8.4战士的例子使用SimpleTrigger。它频率是没10秒一次,无限循环。为了更进一步测试插件,我们创建第2个job文件,与第一个相比有一些小不同。列表8.5显示了第2个job文件。
<o:p> </o:p>
Listing 8.5. A Second Job XML File Loaded by the JobLoaderPlugin<o:p></o:p>
列表8.5 JobLoaderPlugin加载的第2个job XML文件<o:p></o:p>
- <?xml version='1.0' encoding='utf-8'?>
- <quartz xmlns="http://www.opensymphony.com/quartz/JobSchedulingData"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.opensymphony.com/quartz/JobSchedulingData
- http://www.opensymphony.com/quartz/xml/job_scheduling_data_1_5.xsd"
- version="1.5">
- <job>
- <job-detail>
- <name>PrintInfoJob2</name>
- <group>DEFAULT</group>
- <job-class>
- org.cavaness.quartzbook.chapter3.ScanDirectoryJob</job-class>
- <volatility>false</volatility>
- <durability>false</durability>
- <recover>false</recover>
- <job-data-map allows-transient-data="true">
- <entry>
- <key>SCAN_DIR</key>
- <value>c:\quartz-book\input2</value>
- </entry>
- </job-data-map>
- </job-detail>
- <trigger>
- <simple>
- <name>trigger2</name>
- <group>DEFAULT</group>
- <job-name>PrintInfoJob2</job-name>
- <job-group>DEFAULT</job-group>
- <start-time>2005-07-30T16:04:00</start-time>
- <!-- repeat indefinitely every 10 seconds -->
- <repeat-count>-1</repeat-count>
- <repeat-interval>60000</repeat-interval>
- </simple>
- </trigger>
- </job>
- </quartz>
The second job file in Listing 8.5 differs only slightly from the one in Listing 8.4. We've changed the directory for the job, which is scanned and changed the trigger schedule. The point here is that you can have multiple jobs in the jobs directory, and the JobLoaderPlugin will load them all and schedule them individually with the Scheduler.
<o:p> </o:p>
列表8.5显示的第2个job文件与8.4显示的第一个相比只有一点不同。我们改变了搜索改变触发调度作业的文件夹。有一点注意的是你可以放多个job文件到文件夹中,JobLoaderPlugin将分别加载并用Scheduler调度他们。(老外就是这样说了好几遍还罗嗦^_^)
<o:p> </o:p>
Using Multiple Plug-Ins<o:p></o:p>
使用多个插件<o:p></o:p>
You can register as many plug-ins in the quartz.properties file as you like. However, the order of loading and initialization can't be guaranteed because Quartz loads all the properties into a map and then loops through the plug-ins in the order that they are retrieved from the map.
<o:p> </o:p>
你可以在quartz.properties文件中注册任意多个插件。然而加载初始化的顺序不能保证,因为Quartz加载所有的属性到Map中然后按map的中的顺序查找插件。
<o:p> </o:p>
To get around this limitation, you can create a Quartz plug-in that acts as a parent plug-in and loads multiple other plug-ins in a given order. Listing 8.6 shows what the ParentPlugin looks like.
<o:p> </o:p>
为绕开这一限制,你可以建立一个Quartz插件做为其他插件的父插件。该插件按指定顺序加载其他插件。列表8.6展示了父插件的样子。
<o:p> </o:p>
Listing 8.6. The ParentPlugin Can Load Child Plug-Ins in a Specified Order<o:p></o:p>
列表8.6 父插件可以按指定顺序加载子插件<o:p></o:p>
- package org.cavaness.quartzbook.chapter8;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.StringTokenizer;
- import org.apache.commons.logging.Log;
- import org.apache.commons.logging.LogFactory;
- import org.quartz.Scheduler;
- import org.quartz.SchedulerConfigException;
- import org.quartz.SchedulerException;
- import org.quartz.spi.SchedulerPlugin;
- public class ParentPlugin implements SchedulerPlugin {
- private static Log logger = LogFactory.getLog(ParentPlugin.class);
- // A list of child plug-ins
- //子插件列表
- private List childPlugins = new ArrayList();
- private String childPluginNames;
- private String pluginName;
- private Scheduler scheduler;
- /**
- * Default no-arg Constructor
- *
- */
- public ParentPlugin() {
- }
- /**
- * Pass the initialize call on to the child plug-ins.
- *
- * @throws SchedulerConfigException
- * if there is an error initializing.
- */
- public void initialize(String name, final Scheduler scheduler)
- throws SchedulerException {
- this.pluginName = name;
- this.scheduler = scheduler;
- logger.info("Searching for child plugins to load");
- // The child plug-ins are comma-separated
- StringTokenizer tokenizer =
- new StringTokenizer(childPluginNames, ",");
- while (tokenizer.hasMoreElements()) {
- String pluginClassname = tokenizer.nextToken();
- try {
- Class pluginClass =
- Class.forName(pluginClassname);
- Object obj = pluginClass.newInstance();
- // Make sure the specified class is a plug-in
- if (obj instanceof SchedulerPlugin) {
- // Initialize the Plugin
- SchedulerPlugin childPlugin =
- (SchedulerPlugin) obj;
- logger.info("Init child Plugin " +
- pluginClassname);
- childPlugin.initialize(pluginClassname,
- scheduler);
- // Store the child plug-in in the list
- childPlugins.add(childPlugin);
- } else {
- // Skip loading class
- logger.error("Class is not a plugin " +
- pluginClass);
- }
- } catch (Exception ex) {
- // On error, log and go to next child plug-in
- logger.error("Error loading plugin " +
- pluginClassname, ex);
- }
- }
- }
- public void start() {
- // Start each child plug-in
- int size = childPlugins.size();
- for (int i = 0; i < size; i++) {
- SchedulerPlugin childPlugin =
- ((SchedulerPlugin) childPlugins.get(i));
- logger.info("Starting Child Plugin " + childPlugin);
- childPlugin.start();
- }
- }
- public void shutdown() {
- // Stop each child plug-in
- int size = childPlugins.size();
- for (int i = 0; i < size; i++) {
- SchedulerPlugin childPlugin =
- ((SchedulerPlugin) childPlugins.get(i));
- logger.info("Stopping Plugin " + childPlugin);
- childPlugin.shutdown();
- }
- }
- public String getPluginName() {
- return pluginName;
- }
- public void setPluginName(String pluginName) {
- this.pluginName = pluginName;
- }
- public String getChildPluginNames() {
- return childPluginNames;
- }
- public void setChildPluginNames(String childPluginNames) {
- this.childPluginNames = childPluginNames;
- }
- }
- &nbs
发表评论
-
JQuery CookBook翻译连载7(第四章)
2010-06-29 18:45 1031今天超级爆发,整理出来第四章中文版翻译。 -
JQuery CookBook翻译连载6(第三章)
2010-06-29 11:31 1016放出jQuery CookBook翻译的第三章。 最近找工作 ... -
JQuery CookBook 翻译连载6(第2章发布)
2010-06-01 14:15 955jQuery Cookbook第1、2章合订版。 不知 ... -
JQuery CookBook 翻译连载5(第1章发布)
2010-05-16 16:55 933jQuery cookBook 第一章翻译打包发布。 ... -
JQuery CookBook翻译连载1
2010-05-14 11:46 8221.1 在HTML页面中添加j ... -
JQuery CookBook翻译连载2
2010-05-14 11:45 8101.2 在页面DOM加载结束后、整个页面加载结束前执行jQue ... -
JQuery CookBook翻译连载3
2010-05-14 11:34 7081.3 使用选择器及jQuery函 ... -
JQuery CookBook翻译连载4
2010-05-14 11:09 6891.4 在特定的上下文 中查找元素 问 ... -
Quartz Job Scheduling Framework第11章翻译初稿
2007-10-27 15:21 1069内容在附件中 -
Quartz Job Scheduling Framework第7章翻译初稿
2007-10-27 15:18 1145内容在附件中 -
Quartz Job Scheduling Framework第5章翻译初稿
2007-10-27 15:18 975在附件中 -
Quartz Job Scheduling Framework第2章翻译初稿
2007-10-27 15:17 1155在附件中 -
Quartz Job Scheduling Framework第8章翻译初稿
2007-09-27 19:42 2633Chapter 8. Using Quartz Plug- ... -
Quartz Job Scheduling Framework翻译初稿奉上
2007-09-26 21:55 1608由于时间与水平限制。这本经典书籍翻译的可能并不尽如人意,在此先 ... -
Quartz Job Scheduling Framework第10章翻译初稿 续
2007-09-26 21:53 2024In the example in Listing 10. ... -
Quartz Job Scheduling Framework第10章翻译初稿
2007-09-26 21:40 2624Chapter 10. Using Quartz with J ...
相关推荐
Quartz Job Scheduling Framework是一个强大的、开放源代码的作业调度框架,它使应用程序能够在指定的时间执行任务,无需人工干预。这个框架广泛应用于Java应用程序中,用于实现定时任务和工作流管理。在第11章中,...
在阅读《Quartz Job Scheduling Framework》第5章时,你会了解到如何创建和配置Cron Triggers,如何结合SimpleTrigger和CalendarIntervalTrigger实现不同类型的定时任务,以及如何优化Quartz的配置以适应大规模的...
Quartz Job Scheduling Framework第2章翻译初稿 博文链接:https://adamed.iteye.com/blog/135880
Quartz Job Scheduling Framework是一个强大的、开源的作业调度框架,用于在Java应用程序中安排任务执行。这个框架允许开发者创建和管理作业,以及定义作业的触发时间。第7章的主题聚焦于实现Quartz监听器,这是一个...
qtz40塔式起重机总体及塔身有限元分析法设计().zip
Elasticsearch是一个基于Lucene的搜索服务器
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
美国纽约HVAC(暖通空调)数据示例,谷歌地图数据包括:时间戳、名称、类别、地址、描述、开放网站、电话号码、开放时间、更新开放时间、评论计数、评级、主图像、评论、url、纬度、经度、地点id、国家等。 在地理位置服务(LBS)中,谷歌地图数据采集尤其受到关注,因为它提供了关于各种商业实体的详尽信息,这对于消费者和企业都有极大的价值。本篇文章将详细介绍美国纽约地区的HVAC(暖通空调)系统相关数据示例,此示例数据是通过谷歌地图抓取得到的,展示了此技术在商业和消费者领域的应用潜力。 无需外网,无需任何软件抓取谷歌地图数据:wmhuoke.com
2023-04-06-项目笔记-第四百五十五阶段-课前小分享_小分享1.坚持提交gitee 小分享2.作业中提交代码 小分享3.写代码注意代码风格 4.3.1变量的使用 4.4变量的作用域与生命周期 4.4.1局部变量的作用域 4.4.2全局变量的作用域 4.4.2.1全局变量的作用域_1 4.4.2.453局变量的作用域_453- 2025-04-01
1_实验三 扰码、卷积编码及交织.ppt
北京交通大学901软件工程导论必备知识点.pdf
内容概要:本文档总结了 MyBatis 的常见面试题,涵盖了 MyBatis 的基本概念、优缺点、适用场合、SQL 语句编写技巧、分页机制、主键生成、参数传递方式、动态 SQL、缓存机制、关联查询及接口绑定等内容。通过对这些问题的解答,帮助开发者深入理解 MyBatis 的工作原理及其在实际项目中的应用。文档不仅介绍了 MyBatis 的核心功能,还详细解释了其在不同场景下的具体实现方法,如通过 XML 或注解配置 SQL 语句、处理复杂查询、优化性能等。 适合人群:具备一定 Java 开发经验,尤其是对 MyBatis 有初步了解的研发人员,以及希望深入了解 MyBatis 框架原理和最佳实践的开发人员。 使用场景及目标:①理解 MyBatis 的核心概念和工作原理,如 SQL 映射、参数传递、结果映射等;②掌握 MyBatis 在实际项目中的应用技巧,包括 SQL 编写、分页、主键生成、关联查询等;③学习如何通过 XML 和注解配置 SQL 语句,优化 MyBatis 性能,解决实际开发中的问题。 其他说明:文档内容详尽,涵盖面广,适合用于面试准备和技术学习。建议读者在学习过程中结合实际项目进行练习,以更好地掌握 MyBatis 的使用方法和技巧。此外,文档还提供了丰富的示例代码和配置细节,帮助读者加深理解和应用。
《基于YOLOv8的智能电网设备锈蚀评估系统》(包含源码、可视化界面、完整数据集、部署教程)简单部署即可运行。功能完善、操作简单,适合毕设或课程设计
插头模具 CAD图纸.zip
资源内项目源码是来自个人的毕业设计,代码都测试ok,包含源码、数据集、可视化页面和部署说明,可产生核心指标曲线图、混淆矩阵、F1分数曲线、精确率-召回率曲线、验证集预测结果、标签分布图。都是运行成功后才上传资源,毕设答辩评审绝对信服的保底85分以上,放心下载使用,拿来就能用。包含源码、数据集、可视化页面和部署说明一站式服务,拿来就能用的绝对好资源!!! 项目备注 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、大作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.txt文件,仅供学习参考, 切勿用于商业用途。
《基于YOLOv8的智慧农业水肥一体化控制系统》(包含源码、可视化界面、完整数据集、部署教程)简单部署即可运行。功能完善、操作简单,适合毕设或课程设计
python爬虫;智能切换策略,反爬检测机制
台区终端电科院送检文档
e235d-main.zip
丁祖昱:疫情对中国房地产市场影响分析及未来展望