1.定时任务配置文件
src/main/resources/spring-mvc-timeTask.xml
2.新定义一个定时任务举例
a.配置定时任务,配置文件spring-mvc-timeTask.xml
<!-- 定时任务配置 taskDemoService 可配置到管理界面 -->
<bean id="taskDemoServiceTaskJob"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="taskDemoService" />
<property name="targetMethod" value="work" />
<property name="concurrent" value="true" />
</bean>
<bean id="taskDemoServiceTaskCronTrigger" class="org.jeecgframework.core.timer.DataBaseCronTriggerBean">
<property name="jobDetail" ref="taskDemoServiceTaskJob" />
<property name="cronExpression" value="0 0/1 * * * ?" />
</bean>
b.配置位置二
3.定时任务在线控制(启动,停止,时间修改)