动态改变Spring定时任务执行频率
动态改变Spring定时任务执行频率 一.引入 由于公司门户系统需要定时推送数据进国家平台,所以首先想到的是利用spring的定时任务进行定时推送,当然对于这种需求比较简单,如下操作即可: 1.打开任务调度使用,在applicationContext.xml中添加 <task:annotation-driven />,即配置打开了任务调度 当然注意了:头文件上需要加上 [html] view plain copy <beansxmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:task="http://www.springframework.org/schema/task" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/...