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

spring注解配置quartz的更多相关文章

  1. 关于Spring注解配置的步骤

    今天分享一下 关于Spring注解配置的流程 1 导包:如下图所示 2 书写User和Car类  代码如下 package cn.lijun.bean; public class Car { priv ...

  2. Spring注解配置和xml配置优缺点比较

    Spring注解配置和xml配置优缺点比较 编辑 ​ 在昨天发布的文章<spring boot基于注解方式配置datasource>一文中凯哥简单的对xml配置和注解配置进行了比较.然后朋 ...

  3. spring注解配置实例

    在spring中使用注解配置前需要先在配置文件指定需要扫描的包. 通过注解的方式依赖注入,可以不用创建set方法,也不用在xml文件中申明注入关系. 实例结构如下: 整个流程是: 先创建好数据库的表对 ...

  4. spring注解配置启动过程

    最近看起spring源码,突然想知道没有web.xml的配置,spring是怎么通过一个继承于AbstractAnnotationConfigDispatcherServletInitializer的 ...

  5. 【Spring实战】Spring注解配置工作原理源码解析

    一.背景知识 在[Spring实战]Spring容器初始化完成后执行初始化数据方法一文中说要分析其实现原理,于是就从源码中寻找答案,看源码容易跑偏,因此应当有个主线,或者带着问题.目标去看,这样才能最 ...

  6. Spring注解配置Aop

    之前学习了SpringAop的基本原理.http://www.cnblogs.com/expiator/p/7977975.html 现在尝试使用注解来配置SpringAop. Aop,面向切面编程. ...

  7. 5.spring:注解配置 Bean

    在classpath中扫描组件 组键扫描:能够从classpath下自动扫描,侦测和实例化具有特定注解的组件 特定的组件包括: ->@Componment:基于注解,标识一个受Spring管理的 ...

  8. 【转】【Spring实战】Spring注解配置工作原理源码解析

    一.背景知识 在[Spring实战]Spring容器初始化完成后执行初始化数据方法一文中说要分析其实现原理,于是就从源码中寻找答案,看源码容易跑偏,因此应当有个主线,或者带着问题.目标去看,这样才能最 ...

  9. Spring 注解配置Bean

    一.使用注解配置Bean 1.注解 在类定义.方法定义.成员变量定义前使用.其简化<bean>标签,功能同<bean>标签.格式为: @注解标记名. 2.组件扫描 Spring ...

随机推荐

  1. .Net C#上传文件最大设置

    <!--网页允许的最大设置节点--> <system.web> <httpRuntime targetFramework="4.5" maxReque ...

  2. WIN8.1 IE11 F12开发者人员工具,开启什么都不显示

    WIN8.1 IE11 F12开发者人员工具,开启什么都不显示,求大神帮忙?  IE11也没法重装, 还原IE设置过了. 没有效果.   也试过把IE停掉,重启后再重新打开 也没用 已经解决了  删除 ...

  3. Visual Studio中Debug和Release的区别

    在Visual Studio中,生成应用程序的时候有2种模式:Debug和Release.两者之间如何取舍呢? 假设有这么简单的一段代码,在主程序中调用方法M1,M1方法调用M2方法,M2方法调用M3 ...

  4. java跨域解决

    import java.util.ArrayList; import java.util.List; import org.springframework.context.annotation.Bea ...

  5. nsstring 怎么包含”(引号)号

    使用转义字符 \ 即可.如下: [NSString *string = @"\"好\""]; NSLog("%@",string); 打印结 ...

  6. [Mongo] 解决mongoose不支持条件操作符 $gt$gte:$lte$ne $in $all $not

    reference : http://blog.sina.com.cn/s/blog_4df23d840100u25x.html 找到mongoose的安装目录 /usr/local/lib/node ...

  7. [Android Pro] Android源码编译后,再重编译所需要做的清理工作

    1.在源码目录的根目录下,make clean; 2.进到源码的\linux\kernel\目录下,执行make mrproper: 3.再退回到根目录,执行source  build/envsetu ...

  8. 简明python教程 --C++程序员的视角(五):面向对象的编程

    面向对象的编程 在大多数时候你可以使用过程性编程,但是有些时候当你想要编写大型程序或是寻求一个更加合适的解决方案的时候,你就得使用面向对象的编程技术. 对象可以使用普通的属于对象的变量存储数据.属于一 ...

  9. Coursera课程《大家的python》(Python for everyone)课件

    You can access the Google Drive containing all of the current and in-progress lecture slides for thi ...

  10. jQuery的deferred对象使用笔记

    一.什么是deferred对象? 开发网站的过程中,我们经常遇到某些耗时很长的javascript操作.其中,既有异步的操作(比如ajax读取服务器数据),也有同步的操作(比如遍历一个大型数组),它们 ...