常规配置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.

最新文章

  1. LeetCode Find All Duplicates in an Array
  2. 给定时器settimeout、setInterval调用传递参数
  3. 51nod 1101换零钱(背包)
  4. 第1章 认识jQuery
  5. bean之间的关系:继承、依赖
  6. Unity3D中Console控制台的扩展
  7. mysql explain输出中type的取值说明
  8. OpenCV 连接 Android IP摄像头
  9. 全国计算机等级考试二级教程-C语言程序设计_第5章_循环结构
  10. iOS系统自带的 UIAlertView 自动旋转的实现
  11. Android 修改底部导航栏navigationbar的颜色
  12. hudson配置教程
  13. DOM树节点和事件
  14. 来自projecteuler.net网站的练习题1
  15. Python 创建递归文件夹
  16. 让CPU占用率曲线听你指挥
  17. App Store评论优化,让你的APP评论上涨
  18. Linux配置JDK、Tomcat和Mysql免安装版
  19. grid-layout
  20. pascalcontext-fcn全卷积网络结构理解

热门文章

  1. How to install WP 8.0 SDK if WP 8.1 SDK is installed?
  2. MVC自定义路由02-实现IRouteConstraint限制控制器名
  3. IOS开发之深拷贝与浅拷贝(mutableCopy与Copy)详解
  4. 使用 NSPropertyListSerialization 持久化字典与数组
  5. C++ Primer 学习笔记_72_面向对象编程 --句柄类与继承[续]
  6. C# 编程指南
  7. Linux C Socket编程发送结构体、文件详解及实例
  8. Linked List Cycle leetcode java (链表检测环)
  9. Java基础(五):数组和Java方法
  10. operator++()和operator++(int)的区别