本文整理匯總了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);
}