Spring Task定时任务

一.概述:
1.定时任务作为一种常见的需求,在java开发定时任务主要有三种解决方案:
-JDK的timer
-第三方组件: Quartz
-Spring Task
2.Timer是jdk自带的定时任务工具,对于复杂的定时规则无法满足,在实际项目中也不常用;
Quartz功能强大,但使用相对笨重。
Spring Task 则具备两者的优点,除相关的Spring包以外,不需要额外的包,支持注解和配置文件两种形式。


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:task="http://www.springframework.org/schema/task"<

你可能感兴趣的:(Spring,spring,java,后端)