Pause the {@link Trigger} with the given name.
{@link Trigger}
180181182183184185186187188189190
if (!s.isShutdown()) { if (!isPersistent()) { s.unscheduleJob(trigger.getKey()); } else { s.pauseTrigger(trigger.getKey()); } } } catch (SchedulerException e) { throw new EJBException("fail to cancel the timer", e); }
210211212213214215216217218219220
pause(trigger.getKey()); } public static void pause(TriggerKey key) throws SchedulerException { Scheduler sched = StdSchedulerFactory.getDefaultScheduler(); sched.pauseTrigger(key); } public static void delete(Trigger trigger) throws SchedulerException { delete(trigger.getKey()); }
211212213214215216217218219220221
193194195196197198199200201202203
} } else if (pauseJob) { boolean isClustered = scheduler.getMetaData().isJobStoreClustered(); if (!scheduler.isShutdown() && !isClustered) { LOG.info("Pausing job {}", triggerKey); scheduler.pauseTrigger(triggerKey); jobAdded.set(false); } }
343344345346347348349350351352353
jobPaused.set(true); Scheduler scheduler = getComponent().getScheduler(); if (scheduler != null) { LOG.info("Pausing trigger {}", triggerKey); scheduler.pauseTrigger(triggerKey); } } public void resumeTrigger() throws Exception { if (!jobPaused.get()) {