官网Api:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html#scheduling-annotation-support-scheduled

1.initialDelay :初次执行任务之前需要等待的时间

@Scheduled(initialDelay =5000)
public void doSomething() { }

2.fixedDelay:每次执行任务之后间隔多久再次执行该任务。

@Scheduled(fixedDelay=5000)
public void doSomething() {
// something that should execute periodically
}

3.fixedRate:执行频率,每隔多少时间就启动任务,不管该任务是否启动完成

@Scheduled(fixedRate=5000)
public void doSomething() { }

4.cron=“”设置时分秒等具体的定时,网上很很多相关列子。

例如:转:http://blog.csdn.net/kkdelta/article/details/7238581

@Scheduled(cron="*/5 * * * * MON-FRI")
public void doSomething() {
// something that should execute on weekdays only
}

Spring 调度任务@scheduled学习总结的更多相关文章

  1. [Spring]支持注解的Spring调度器

    概述 如果想在Spring中使用任务调度功能,除了集成调度框架Quartz这种方式,也可以使用Spring自己的调度任务框架. 使用Spring的调度框架,优点是:支持注解(@Scheduler),可 ...

  2. Spring+SpringMVC+MyBatis深入学习及搭建(十二)——SpringMVC入门程序(一)

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6999743.html 前面讲到:Spring+SpringMVC+MyBatis深入学习及搭建(十一)——S ...

  3. Spring+SpringMVC+MyBatis深入学习及搭建(十二)——SpringMVC入门程序

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6999743.html 前面讲到:Spring+SpringMVC+MyBatis深入学习及搭建(十一)--S ...

  4. Spring Boot中@Scheduled注解的使用方法

    Spring Boot中@Scheduled注解的使用方法 一.定时任务注解为@Scheduled,使用方式举例如下 //定义一个按时间执行的定时任务,在每天16:00执行一次. @Scheduled ...

  5. Spring+SpringMVC+MyBatis深入学习及搭建(二)——MyBatis原始Dao开发和mapper代理开发

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6869133.html 前面有写到Spring+SpringMVC+MyBatis深入学习及搭建(一)——My ...

  6. Spring+SpringMVC+MyBatis深入学习及搭建(三)——MyBatis全局配置文件解析

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6874672.html 前面有写到Spring+SpringMVC+MyBatis深入学习及搭建(二)——My ...

  7. Spring+SpringMVC+MyBatis深入学习及搭建(四)——MyBatis输入映射与输出映射

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6878529.html 前面有讲到Spring+SpringMVC+MyBatis深入学习及搭建(三)——My ...

  8. Spring+SpringMVC+MyBatis深入学习及搭建(五)——动态sql

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6908763.html 前面有讲到Spring+SpringMVC+MyBatis深入学习及搭建(四)——My ...

  9. Spring+SpringMVC+MyBatis深入学习及搭建(六)——MyBatis关联查询

    转载请注明出处:http://www.cnblogs.com/Joanna-Yan/p/6923464.html 前面有将到:Spring+SpringMVC+MyBatis深入学习及搭建(五)--动 ...

随机推荐

  1. handle exceptions, opening and closing database connections

    https://www.tutorialspoint.com/spring/spring_jdbc_framework.htm Spring - JDBC Framework Overview Whi ...

  2. talib 中文文档(十):Price Transform Functions 价格指标

    Price Transform Functions AVGPRICE - Average Price 函数名:AVGPRICE 名称:平均价格函数 real = AVGPRICE(open, high ...

  3. MySQL 慢查询日志工具之pt-query-digest

    1. 工具简介 pt-query-digest是用于分析mysql慢查询的一个工具,它可以分析binlog.General log.slowlog,也可以通过SHOWPROCESSLIST或者通过tc ...

  4. docker网络部分源码分析

    daemon初始化network controller daemon的配置,网络部分的内容在cmd/dockerd/config_common_unix.go中指定,默认设置一般都为空 // daem ...

  5. List的三个子类ArrayList,LinkedList,Vector区别

    一:List的三个子类的特点 ArrayList: 底层数据结构是数组,查询快,增删慢. 线程不安全,效率高.Vector: 底层数据结构是数组,查询快,增删慢. 线程安全,效率低.Vector相对A ...

  6. Windows7系统运行hadoop报Failed to locate the winutils binary in the hadoop binary path错误

    程序运行的过程中,报Failed to locate the winutils binary in the hadoop binary path  Java.io.IOException: Could ...

  7. HDU1556:Color the ball(简单的线段树区域更新)

    http://acm.hdu.edu.cn/showproblem.php?pid=1556 Problem Description N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定 ...

  8. NFS-网络文件共享服务

    目录 NFS介绍 什么是NFS(Network File System) 搭建NFS服务需要的软件包 极简步骤搭建NFS服务 准备两台机器 配置服务端(nfs-server) 配置客户端(web-cl ...

  9. 查T结果与Z结果的P值[转载]

    T检验P值表格来自:https://blog.csdn.net/m0_37777649/article/details/74937242 Z检验表格来自:https://wenku.baidu.com ...

  10. 'React/RCTBundleURLProvider.h' file not found

    'React/RCTBundleURLProvider.h' file not found 新建RN项目时在iOS端用xcode跑时有时会遇到 'React/RCTBundleURLProvider. ...