本文整理了Java中org.quartz.Scheduler.pauseJobs()
方法的一些代码示例,展示了Scheduler.pauseJobs()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.pauseJobs()
方法的具体详情如下:
包路径:org.quartz.Scheduler
类名称:Scheduler
方法名:pauseJobs
[英]Pause all of the org.quartz.JobDetails
in the matching groups - by pausing all of their Trigger
s.
The Scheduler will "remember" the groups paused, and impose the pause on any new jobs that are added to any of those groups until it is resumed.
NOTE: There is a limitation that only exactly matched groups can be remembered as paused. For example, if there are pre-existing job in groups "aaa" and "bbb" and a matcher is given to pause groups that start with "a" then the group "aaa" will be remembered as paused and any subsequently added jobs in group "aaa" will be paused, however if a job is added to group "axx" it will not be paused, as "axx" wasn't known at the time the "group starts with a" matcher was applied. HOWEVER, if there are pre-existing groups "aaa" and "bbb" and a matcher is given to pause the group "axx" (with a group equals matcher) then no jobs will be paused, but it will be remembered that group "axx" is paused and later when a job is added in that group, it will become paused.
[中]暂停匹配组中的所有org.quartz.JobDetails
——暂停所有Trigger
组。
调度程序将“记住”暂停的组,并对添加到这些组中的任何新作业施加暂停,直到恢复为止。
注意:有一个限制,只有完全匹配的组才能被记忆为暂停。例如,如果在“aaa”和“bbb”组中存在预先存在的作业,并且提供了一个匹配器来暂停以“a”开头的组,则组“aaa”将被记住为已暂停,并且组“aaa”中随后添加的任何作业都将暂停,但如果将作业添加到组“axx”,则不会暂停,因为在应用“组从一个匹配器开始”时,不知道“axx”。但是,如果存在预先存在的组“aaa”和“bbb”,并且提供了一个匹配器来暂停组“axx”(组等于匹配器),则不会暂停任何作业,但请记住,组“axx”已暂停,稍后在该组中添加作业时,它将暂停。
代码示例来源:origin: lvhao/schedule-job
public boolean disable(GroupMatcher<JobKey> matcher){
try {
scheduler.pauseJobs(matcher);
return true;
} catch (SchedulerException e) {
e.printStackTrace();
}
return false;
}
代码示例来源:origin: myschedule/myschedule-quartz-extra
public void pauseJobs(GroupMatcher<JobKey> groupMatcher) {
try {
scheduler.pauseJobs(groupMatcher);
} catch (SchedulerException e) {
throw new QuartzRuntimeException(e);
}
}
代码示例来源:origin: org.codelibs/elasticsearch-quartz
public void pauseJobs(final GroupMatcher<JobKey> matcher) {
try {
scheduler.pauseJobs(matcher);
} catch (final SchedulerException e) {
throw new QuartzSchedulerException(e);
}
}
代码示例来源:origin: OpenWiseSolutions/openhub-framework
@Override
public void pauseJobs(GroupMatcher<JobKey> matcher) throws SchedulerException {
getScheduler().pauseJobs(matcher);
}
代码示例来源:origin: com.threewks.thundr/thundr-quartz
@Override
public void pauseJobs(GroupMatcher<JobKey> matcher) throws QuartzException {
try {
delegate.pauseJobs(matcher);
} catch (SchedulerException e) {
Logger.error(e.getMessage());
throw new QuartzException(e);
}
}
代码示例来源:origin: com.threewks.thundr/thundr-contrib-quartz
@Override
public void pauseJobs(GroupMatcher<JobKey> matcher) throws QuartzException {
try {
delegate.pauseJobs(matcher);
} catch (SchedulerException e) {
Logger.error(e.getMessage());
throw new QuartzException(e);
}
}
代码示例来源:origin: braveMind/timer
@Override
public void unregister(String appName, String address) {
AppPO appPO = appDomain.getAppInfo(appName, address);
if (appPO != null) {
appPO.setStatus(Boolean.FALSE);
appDomain.updateAppStatus(appPO);
List<String> addressList = appDomain.getAddressListByName(appName, Boolean.TRUE);
if (CollectionUtils.isEmpty(addressList)) {
try {
quartzScheduler.pauseJobs(GroupMatcher.groupEquals(appName));
} catch (SchedulerException e) {
e.printStackTrace();
}
DefaultThreadPool.executor.submit(new ElephantTask(appName));
}
}
}
内容来源于网络,如有侵权,请联系作者删除!