spring注解配置quartz
常规配置quartz可以参考我的另外一篇博文:http://www.cnblogs.com/yangzhilong/p/3349116.html
spring配置文件里增加:
命令空间:
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd
配置:
<task:annotation-driven/>
当然这还需要扫描注解等常规配置。
java代码:
package com.test; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component;@Component public class TestJob {@Scheduled(fixedDelay = 1000) public void test(){System.out.println("job 开始执行");} }
Scheduled类的可配置属性项:
String
|
cron
A cron-like expression, extending the usual UN*X definition to include triggers on the second as well as minute, hour, day of month, month and day of week.
|
long
|
fixedDelay
Execute the annotated method with a fixed period between the end of the last invocation and the start of the next.
|
String
|
fixedDelayString
Execute the annotated method with a fixed period between the end of the last invocation and the start of the next.
|
long
|
fixedRate
Execute the annotated method with a fixed period between invocations.
|
String
|
fixedRateString
Execute the annotated method with a fixed period between invocations.
|
long
|
initialDelay
Number of milliseconds to delay before the first execution of a
fixedRate() or fixedDelay() task.
|
String
|
initialDelayString
Number of milliseconds to delay before the first execution of a
fixedRate() or fixedDelay() task.
|
String
|
zone
A time zone for which the cron expression will be resolved.
|
转载于:https://www.cnblogs.com/yangzhilong/p/3794864.html
spring注解配置quartz相关推荐
- SpringCloud(第 054 篇)简单 Quartz-Cluster 微服务,采用注解配置 Quartz 分布式集群...
2019独角兽企业重金招聘Python工程师标准>>> SpringCloud(第 054 篇)简单 Quartz-Cluster 微服务,采用注解配置 Quartz 分布式集群 一 ...
- SpringCloud(第 054 篇)简单 Quartz-Cluster 微服务,采用注解配置 Quartz 分布式集群... 1
SpringCloud(第 054 篇)简单 Quartz-Cluster 微服务,采用注解配置 Quartz 分布式集群 - 一.大致介绍 1.因网友提到有没有采用注解式配置的Quartz例子,因此 ...
- spring中配置quartz定时器
spring中配置quartz定时器 最近项目中用到定时器,项目用的spring所以想在spring中配置一下定时器,看到网上用quartz的比较多,所以就搜了一下.参考:http://blog.cs ...
- Spring 注解配置
2019独角兽企业重金招聘Python工程师标准>>> http://my.oschina.net/u/1157906/blog/178204 Spring的注解配置 转载于:ht ...
- Spring注解配置工作原理源码解析
一.背景知识 在[Spring实战]Spring容器初始化完成后执行初始化数据方法一文中说要分析其实现原理,于是就从源码中寻找答案,看源码容易跑偏,因此应当有个主线,或者带着问题.目标去看,这样才能最 ...
- spring注解配置
使用注解配置需要引入xml文件约束条件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns ...
- Spring中配置Quartz的misfireInstruction
参考:http://blog.csdn.net/george_hsu/article/details/6943336 最近在做一个自动发送邮件的小功能,其中用到了Quartz来做事件触发.首先说一下, ...
- [内容有误,请看参考和评论区]Spring 注解配置(annotation-config 和 component-scan的不同)
[内容有误,请看参考和评论区]Spring 的xml配置里如何仅通过注解使用(annotation-config 和 component-scan的不同) 这个问题也算看了好几遍还没记住的问题,先抛结 ...
- CXF的Spring注解配置及使用
使用的cxf包版本为 cxf-2.6.1.jar 官方下载地址:CXF下载地址 web.xml配置 <servlet><servlet-name>CXFServ ...
最新文章
- pip install lxml 总是失败
- 深度复盘 | 滴滴专车会员项目如何做好设计优化
- CentoS8 Mysql8 数据目录迁移
- 特斯拉员工入职3天就“偷”代码,悄悄备份6300多Python脚本
- 5天学习MYSQL数据库第一天剩余全部笔记(超级详细的mysql入门笔记适合新手反复看加深记忆)
- mini2440烧写nor flash
- 渗透测试入门21之Metasploit渗透测试常用流程
- Android批量图片加载经典系列——使用二级缓存、异步网络负载形象
- js正则看这篇就够了
- 测试用什么编译java代码_java – 测试编译器
- ASP.NET MVC Model验证
- 【ANSYS命令流】加载与求解技术(四):面载荷(节点)的施加 [重点]
- 宽带波形测试软件,适用于5G时代的波形测试分析系统是怎样的?
- 求1到n的所有质数(素数)
- 云服务器测速脚本_服务器测速命令
- 百度网盘 网页版、pc版 都登陆不进去的解决方法
- opencv 直方图 CV::calcHist使用
- 【Python数据类型展示】
- java uml类图虚线实线_终于明白六大类UML类图关系了
- JZOJ2018.07.12【2018提高组】模拟B组 魔道研究
热门文章
- Coursera自动驾驶课程第11讲:2D Object Detection
- 黄冈学计算机的学校怎么样,广元市黄冈学校怎么样、好不好
- linux 挂在iso文件,linux 挂载iso文件安装文件 与 网络yum的搭建
- Caused by: java.lang.IllegalStateException: StandardEngine[Tomcat].StandardHost[localhost].TomcatEmb
- 根据中序、前序遍历重建二叉树
- redis——缓存击穿/穿透/雪崩
- TensorFlow(1)-模型相关基础概念
- Git(10)-merge
- 用Python在Tomcat成功启动后自动打开浏览器访问Web应用
- STL源码剖析 内存基本处理工具 初始化空间的五个函数