Spring + quartz 动态设置时间
开启暂停功能
applicaonContext-quartz.xml 配置
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="sysScheduleService"
class="com.wxws.sysmanager.service.impl.SysScheduleServiceImpl" />
<bean id="schedulerJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailF
actoryBean">
<property name="targetObject" ref="sysScheduleService" />
<property name="targetMethod" value="reScheduleJob" />
<property name="concurrent" value="false" />
</bean>
<bean id="cronTrigger"
class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="schedulerJobDetail" />
<property name="cronExpression">
<value>0/20 * * * * ?</value>
</property>
</bean>
<bean id="schedulerFactory"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="cronTrigger" />
</list>