有人知道怎么搞吗,要配置监听器吗
TriggerKey triggerKey = TriggerKey.triggerKey("myjob1","mygroup");
Trigger trigger = scheduler.getTrigger(triggerKey);
if (null != trigger) {
JobKey jobKey = JobKey.jobKey("myjob1","mygroup");
scheduler.deleteJob(jobKey);
这个是xml中detail的配置
<bean id="jobDetail2"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="name" value="myjob1"></property>
<property name="group" value="mygroup"></property>
<!-- false表示等上一个任务执行完后再开启新的任务 -->
<property name="concurrent" value="false" />
<property name="targetObject">
<ref bean="myJob" />
</property>
<property name="targetMethod" value="work2">
</property>
</bean>
<bean id="myTrigger2"
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="name" value="myjob1"></property>
<property name="group" value="mygroup"></property>
<property name="jobDetail" ref="jobDetail2"></property>
<property name="cronExpression">
<value>0/12 * * * * ?</value>
</property>
</bean>
------解决方案--------------------
暂定是scheduler.pause开头的方法,具体的自己去看api,删除,就是deleteJob方法吧。