spring task 配置
1.引入名称空间
xmlns:task="http://www.springframework.org/schema/task"
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task-4.3.xsd
2.<!--开启这个配置,spring才能识别@Scheduled注解,spring task配置
<task:annotation-driven scheduler="qbScheduler" mode="proxy"/>
<task:scheduler id="qbScheduler" pool-size="10"/>
<task:scheduled-tasks scheduler="qbScheduler">
<task:scheduled ref="remoteScheduleController" method="timeTask" cron="0/1 * * * * ?"/>
</task:scheduled-tasks>
-->
其他配置固定,要做的就是配置作业类和目标方法
3.在定时方法上使用@Schedule(cron="")注解