常规配置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. win8.1快速启动选项突然消失了怎么办?

    win8开始提供的快速启动功能是一种混合式的休眠模式,Windows系统 在关机时将系统的信息保存到硬盘上的一个文件中来实现下一次的快速启动.当再次启动电脑时, Windows 使用该系统信息文件来恢 ...

  2. 如何使用C#关键字const,readonly,static

    如果有一个值不太会变化,我们经常使用const和readonly,这2者有何不同呢?有时候,我们也会在readonly之前加上关键字static,这又意味着什么呢? const ● const默认是静 ...

  3. 常用VPS测试工具整理

    来源: http://www.vpser.net/manage/vps-test-tool.html 购买VPS前主要是使用一些网络测试工具如ping.tracert.WinMTR之类的工具进行测试, ...

  4. 【java】关于Map的排序性的一次使用,有序的Map

    关于Map的排序性的一次使用,有序的Map >>>>> hashmap是按key的hash码排序的,而treemap是利用comparator 进行key的自然排序的 / ...

  5. 命令行编译工具NMAKE

    简介 大家已经习惯于微软提供的功能强大的IDE,已经很少考虑手动编连项目了,所谓技多不压身,有空的时候还是随我一块了解一下命令行编译. C/C++/VC++程序员或有Unix/Linux编程经验应该很 ...

  6. java使用POI获取sheet、行数、列数

    FileInputStream inp = new FileInputStream("E:\\WEIAN.xls"); HSSFWorkbook wb = new HSSFWork ...

  7. Redis五大数据结构

    1.Redis介绍 Redis是REmote DIctionary Server的缩写,作者定位于一个内存KV存储数据库(In-memory key-value Store),让Redis自豪的并不是 ...

  8. Gedit

    Use Gedit as Remote File Editor via FTP and SSH Migrating from Windows Vista to Ubuntu 8.04 and have ...

  9. iOS:UIPickerView选择器的使用

    通过UIPickerView选择器做的一个类似于密码锁的日期时间表 源码如下: #import <UIKit/UIKit.h> @interface ViewController : UI ...

  10. Linux 挂载和卸载U盘

    一般的U盘挂载方法: mount [-fnrsvw]  [-t vfstype] [-o options] device dir 参数:device表示要挂载的设备,dir表示挂载点 -t 指定设备的 ...