三)Wiring up jobs using triggers and the SchedulerFactoryBean
示例地址: https://github.com/witaste/quartz.git
│ pom.xml
│
└─src
└─main
├─java
│ └─cn
│ └─zno
│ └─job
│ Breathe.java
│ Main.java
│
└─resources
Beans-Quartz.xml
两种触发器:简单的触发器和cron表达式触发器
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<!-- <ref bean="cronTrigger" /> -->
<ref bean="simpleTrigger" />
</list>
</property>
</bean> <bean id="simpleTrigger"
class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean">
<property name="jobDetail" ref="jobDetail" />
<property name="startDelay" value="10000" />
<property name="repeatInterval" value="1000" />
</bean> <!-- <bean id="cronTrigger" -->
<!-- class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> -->
<!-- <property name="jobDetail" ref="jobDetail" /> -->
<!-- <property name="cronExpression" value="* * * ? * *" /> -->
<!-- </bean> --> <bean id="jobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="breath"></property>
<property name="targetMethod" value="show"></property>
</bean> <bean id="breath" class="cn.zno.job.Breathe" />
</beans>
package cn.zno.job;
public class Breathe {
public void show() {
System.out.println(11);
}
}
package cn.zno.job; import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext; public class Main {
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext("Beans-Quartz.xml");
}
}
三)Wiring up jobs using triggers and the SchedulerFactoryBean的更多相关文章
- [译]Quartz 框架 教程(中文版)2.2.x 之第二课 Quartz API,Jobs和Triggers简介
第二课:QuartzAPI,Jobs和Triggers简介 Quartz API Quartz API 关键的几个接口: Scheduler:跟任务调度相关的最主要的API接口. Job:你期望任务调 ...
- Quartz 第二课 Jobs and Triggers(官方文档翻译)
The Quartz API IScheduler—与scheduler交互的主要的接口 IJob—这个接口主要定义scheduler执行内容 IJobDetail—用于定义Jobs实例 ITrigg ...
- Quartz.NET总结(六)了解Jobs 和 Triggers
前面讲了一些Quartz.net 的一些东西, http://www.cnblogs.com/zhangweizhong/category/771057.html 但是发现有一些基础的东西,没有说到. ...
- Spring框架文档与API(4.3.6版本)
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ Table of Contents I ...
- (02) 任务(Jobs)和触发器(Triggers)
Quart 的 API Quartz API 中的关键接口和类如下: IScheduler-与调度器(scheduler)进行交互的主要 API: IJob-被组件继承和实现,由调度器来执行的接口: ...
- 2000条你应知的WPF小姿势 基础篇<63-68 Triggers和WPF类逻辑结构>
在正文开始之前需要介绍一个人:Sean Sexton. 来自明尼苏达双城的软件工程师.最为出色的是他维护了两个博客:2,000ThingsYou Should Know About C# 和 2,00 ...
- Quartz的API简介及Jobs和Trigger介绍
Quartz的API: 主要api: The key interfaces of the Quartz API are: Scheduler - the main API for interactin ...
- Quartz.NET syudy
Quartz.NET Quartz.NET是一个开源的作业调度框架,是OpenSymphony 的 Quartz API的.NET移植,它用C#写成,可用于winform和asp.net应用中.它 ...
- Quartz.net官方开发指南系列篇
Quartz.NET是一个开源的作业调度框架,是OpenSymphony 的 Quartz API的.NET移植,它用C#写成,可用于winform和asp.net应用中.它提供了巨大的灵活性而不牺牲 ...
随机推荐
- Android wm指令用法详解
wm 是查看和设置显示信息的指令,此指令只能临时调试使用. wm:查看 wm 指令信息 $ adb shell root@rk3288:/ # wm wm usage: wm [subcommand] ...
- 如何ping别人的计算机名来获取IP?
来源:http://blog.csdn.net/qq_27109081/article/details/47128175 如何ping别人的计算机名来获取IP? 获取别人的IP, ...
- vim配置之tagbar
vimConfig/plugin/tagbar-setting.vim let g:tagbar_width=4 map <F12> :TagbarToggle<CR> map ...
- MAMP pro mac 本地集成环境 php sal apache等集成软件
http://www.sdifen.com/mamppro411.html 已存在我的百度云盘 安装后,打开 MAMP 第一步:配置启动和停止选项 默认启动项.默认停止项,只需要勾选: 1.Star ...
- jsp---猜数字游戏,深有感触
猜数字游戏注意两点.1.随机数和猜的数字不能放在同一个页面,不然随机数不停出现,猜的数字不可能相等的. 2.数据类型的相互转换.包装类Integer和int的用法,前者是类,后者是基本数据类型 cai ...
- 第八章(三)基于Listcheck适配器的访问控
denier适配器访问控制比较死板.Listchecker的适配器更加灵活. 定义handler: apiVersion: config.istio.io/v1alpha2 kind: listche ...
- solr查询优化(实践了一下效果比较明显)
什么是filtercache? solr应用中为了提高查询速度有可以利用几种cache来优化查询速度,分别是fieldValueCache,queryResultCache,documentCache ...
- CSS 第1练 搜索
1.搜索 效果: <!DOCTYPE HTML> <html> <head> <meta charset="gbk" /> < ...
- fireDAC oracle
copy 4 files to D:\oracleapp\Administrator\product\11.2.0\client_1\BIN setup win 64 bit client .down ...
- php执行linux函数
function B(){ if(defined('LOCK') && LOCK == 'lock') return false; $addPort = sprintf('-A INP ...