版本一:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
">
<!-- quartz配置-1 注册自定义作业类 -->
<bean name="myJob" class="com.test.quartz.helloworld.MyJob"></bean> <!-- quartz配置-2 配置JobDetail -->
<bean name="myJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 注入目标对象 -->
<property name="targetObject" ref="myJob"></property>
<!-- 注入目标方法 -->
<property name="targetMethod" value="run"></property>
</bean> <!--quartz配置-3 配置触发器Trigger -->
<bean name="myTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<!-- 注入任务详情对象 -->
<property name="jobDetail" ref="myJobDetail"></property>
<!-- 注入cron表达式,通过这个表达式指定触发的时间点 -->
<property name="cronExpression">
<!-- 每五秒钟触发一次 -->
<value>0/5 * * * * ?</value>
</property>
</bean>
<!--quartz配置-4 配置scheduler调度工厂-->
<bean name="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<!-- 注入触发器 -->
<property name="triggers">
<list>
<ref bean="myTrigger"/>
</list>
</property>
</bean>
</beans>

025-quartz之spring部分配置模板的更多相关文章

  1. springboot系列四、配置模板引擎、配置热部署

    一.配置模板引擎 在之前所见到的信息显示发现都是以 Rest 风格进行显示,但是很明显在实际的开发之中,所有数据的显示最终都应该交由页面完成,但是这个页面并不是*.jsp 页面,而是普通的*.html ...

  2. Quartz 在 Spring 中如何动态配置时间--转

    原文地址:http://www.iteye.com/topic/399980 在项目中有一个需求,需要灵活配置调度任务时间,并能自由启动或停止调度. 有关调度的实现我就第一就想到了Quartz这个开源 ...

  3. 两种流行Spring定时器配置:Java的Timer类和OpenSymphony的Quartz

    1.Java Timer定时 首先继承java.util.TimerTask类实现run方法 import java.util.TimerTask; public class EmailReportT ...

  4. Spring+Quartz 实现定时任务的配置方法

    Spring+Quartz 实现定时任务的配置方法 整体介绍 一.Quartz介绍 在企业应用中,我们经常会碰到时间任务调度的需求,比如每天凌晨生成前天报表,每小时生成一次汇总数据等等.Quartz是 ...

  5. Spring线程池配置模板设计(基于Springboot)

    目录 线程池配置模板 基础的注解解释 常用配置参数 配置类设计 线程池使用 ThreadPoolTaskExecutor源码 线程池配置模板 springboot给我们提供了一个线程池的实现,它的底层 ...

  6. Spring整合quartz2.2.3总结,quartz动态定时任务,Quartz定时任务集群配置

    Spring整合quartz2.2.3总结,quartz动态定时任务,Quartz定时任务集群配置 >>>>>>>>>>>>&g ...

  7. spring通过配置xml文件集成quartz定时器

    概述 Spring为创建Quartzde Scheduler.Trigger和JobDetail提供了方便的FactoryBean类,以便能够在Spring容器中享受注入的好处. 此外,Spring还 ...

  8. 【Quartz】Spring Boot使用properties文件配置Quartz

    (1)在resource目录下新建quartz.properties文件 #============================================================== ...

  9. Quartz.Net 配置模板范例

        1.App.config <?xml version="1.0" encoding="utf-8"?> <configuration& ...

随机推荐

  1. 数据库索引与b+树

    数据库索引详解 索引 当我们在设计数据库的时候,对表的一些属性有时会加上索引,但索引为什么能提高检索速率呢?是不是用了索引就一定可以提高效率呢?不同索引之间有什么区别呢?搞懂这些问题是灵活运用索引的必 ...

  2. centos7用docker安装kafka

    参考之前的文章安装zookeeper集群  https://www.cnblogs.com/xiaohanlin/p/10124674.html 如果是测试环境也可以简单安装单节点的zookeeper ...

  3. docker kubernetes swarm spring cloud结合学习资源

    http://www.docin.com/p-2062732301.html https://blog.csdn.net/michael_hm/article/details/79213839 htt ...

  4. Python3之XML模块

    一.简介 xml是实现不同语言或程序之间进行数据交换的协议,可扩展标记语言,标准通用标记语言的子集.是一种用于标记电子文件使其具有结构性的标记语言.xml格式如下,是通过<>节点来区别数据 ...

  5. CF914E Palindromes in a Tree(点分治)

    link 题目大意:给定一个n个点的树,每个点都有一个字符(a-t,20个字符) 我们称一个路径是神犇的,当这个路径上所有点的字母的某个排列是回文 求出对于每个点,求出经过他的神犇路径的数量 题解: ...

  6. C#调用存储过程的ADO.Net

    using System.Data.SqlClient; //如果存储过程没有输入和输出参数,而且不返回查询结果 SqlCommand cmd = new SqlCommand("存储过程名 ...

  7. 6、C++共用体

    6.共用体 共用体(union)是一种数据格式,他能够存储不同的数据类型,但只能同时存储其中的一种类型.也就是说,结构可以同时存储int.long和double,共用体只能存储ing.long.dou ...

  8. JSONP原理及简单实现 可做简单插件使用

    JSONP实现跨域通信的解决方案. 在jquery中,我们可以通过$.ajax的dataType设置为jsonp来调用jsonp,但是jsonp和ajax的实现原理一个关系都木有.jsonp主要是通过 ...

  9. pyc和pycodeobject

    Python是一个先编译再解释的语言. 执行过程:先寻找pyc文件,找到则载入,没找到则把编译的结果保存在pycodeobject中,运行结束则写到pyc文件中

  10. 【算法笔记】B1012 数字分类

    1012 数字分类 (20 分) 给定一系列正整数,请按要求对数字进行分类,并输出以下 5 个数字: A​1​​ = 能被 5 整除的数字中所有偶数的和: A​2​​ = 将被 5 除后余 1 的数字 ...