当Tomcat重启之后,如何让Spring 重新启动任务呢?其中使用的quartz任务调度框架。
最后更新时间: 2019-01-04 10:34:50
创建一个SchedulerInitListener监听器
1 | public class SchedulerInitListener implements ApplicationListener<ContextRefreshedEvent>{ |
在applicationContext-dao.xml中加入SchedulerInitListener监听器bean对象
1 | <!-- 当Spring容器启动完成后执行下面的这个Bean --> |