import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service; /**
* Created by chenguangjin on 2018/3/9.
*/
@Service
public class ScheduledTest { @Scheduled(cron = "0 0/1 * * * ?")
public void scheduledMethod(){
System.out.println("scheduled method start!");
} }

依赖:

    <properties>
<spring.version>4.3.6.RELEASE</spring.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
</dependencies>

最新文章

  1. Github fork同步
  2. 使用UIKit制作卡牌游戏(三)ios游戏篇
  3. iOS开发工具——网络封包分析工具Charles
  4. Android 学习笔记之AndBase框架学习(三) 使用封装好的函数完成Http请求..
  5. 【剑指offer】判断二叉树是否为平衡二叉树
  6. 1003: A Bug
  7. Delphi 6 Web Services初步评估
  8. Windows 下如何安装配置Snort视频教程
  9. UVA 12232 - Exclusive-OR(带权并查集)
  10. 根据用户的ID查用户的名字
  11. 移动web开发经验总结(1) (转)
  12. python基本使用事项
  13. C# 解决“请求被中止: 未能创建 SSL/TLS 安全通道”的问题
  14. 第九篇——Struts2的拦截器
  15. 使用Intellij中的Spring Initializr来快速构建Spring Boot/Cloud工程(十五)
  16. [UWP开发] 在低版本中使用亚克力刷以及部分高版本控件
  17. 针对Properties中实时性要求不高的配置参数,用Java缓存起来
  18. C# List的深复制
  19. iframe加载方案及性能
  20. [BZOJ4320][ShangHai2006]Homework(根号分治+并查集)

热门文章

  1. Algorithm | Random
  2. POJ 1704 Georgia and Bob [博弈]
  3. java.lang.NoSuchMethodError: main Exception in thread &quot;main&quot; ===Exception
  4. readis 内部数据结构
  5. ios内存管理笔记(二)
  6. OpenCV3.1使用SIFT
  7. .NET创建宿主设计器--DesignHost、DesignSurface.
  8. DesignSurface简介
  9. C 作用域规则
  10. 【SharePoint】SharePoint2013中使用客户端对象模型给用户控件赋初值