本文整理汇总了Java中org.quartz.Scheduler.pauseTrigger方法的典型用法代码示例。如果您正苦于以下问题:Java Scheduler.pauseTrigger方法的具体用法?Java Scheduler.pauseTrigger怎么用?Java Scheduler.pauseTrigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.quartz.Scheduler
的用法示例。
在下文中一共展示了Scheduler.pauseTrigger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeJob
import org.quartz.Scheduler; //导入方法依赖的package包/类
/**
* @Description 移除一个任务(使用默认的任务组名,触发器名,触发器组名)
* @param jobName
*
*
*/
public static void removeJob(String jobName) {
TriggerKey triggerKey = TriggerKey.triggerKey(
jobName, TRIGGER_GROUP_NAME);
JobKey jobKey = JobKey.jobKey(jobName, JOB_GROUP_NAME);
try {
Scheduler sched = gSchedulerFactory.getScheduler();
Trigger trigger = (Trigger) sched.getTrigger(triggerKey);
if (trigger == null) {
return;
}
sched.pauseTrigger(triggerKey);;// 停止触发器
sched.unscheduleJob(triggerKey);// 移除触发器
sched.deleteJob(jobKey);// 删除任务
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例2: pauseJobTrigger
import org.quartz.Scheduler; //导入方法依赖的package包/类
@Transactional
@Override
public boolean pauseJobTrigger(TriggerKey triggerKey) {
try
{
Scheduler scheduler = schedulerFactoryBean.getScheduler();
scheduler.pauseTrigger(triggerKey);
return Boolean.TRUE;
} catch (SchedulerException e) {
throw new ServiceException(e);
}
}
示例3: removeJobFromScheduler
import org.quartz.Scheduler; //导入方法依赖的package包/类
public void removeJobFromScheduler(String jobDefId,String companyId) throws SchedulerException {
Scheduler scheduler=schedulerService.retrieveScheduler();
JobKey jobKey=new JobKey(JOB_PREFIX+jobDefId,companyId);
TriggerKey triggerKey=new TriggerKey(TRIGGER_PREFIX+jobDefId,companyId);
if(scheduler.checkExists(jobKey)){
scheduler.pauseTrigger(triggerKey);
scheduler.unscheduleJob(triggerKey);
scheduler.deleteJob(jobKey);
}
}
示例4: pauseTrigger
import org.quartz.Scheduler; //导入方法依赖的package包/类
public static void pauseTrigger(String triggerName, String triggerGroup, Scheduler scheduler) throws SchedulerException {
TriggerKey triggerKey = getTriggerKey(triggerName, triggerGroup);
scheduler.pauseTrigger(triggerKey);
}