1、计划任务执行时,action中进来的方法也可以执行,需要flag进行判断。
2、前一个时间没有执行完成,时间超过下一个“指定”的时间,计划任务跳过该时间。可以使用每隔多少分的写法来进行下个任务的执行。
3、执行的计划任务类一定要加@Component。
4、xml中添加
xmlns:task="http://www.springframework.org/schema/task"
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd
<!--计划任务 一共启动五个线程执行,多计划任务时,有没有执行完成的计划任务,可以启动新的线程执行其他计划任务 -->
<task:annotation-driven scheduler="Scheduler" executor="executor" mode="proxy"/>
<task:scheduler id="Scheduler" pool-size="5" />
<task:executor id="executor" keep-alive="300" pool-size="10" queue-capacity="5" rejection-policy="CALLER_RUNS" />