本文整理了Java中org.quartz.Scheduler.resumeJob()
方法的一些代码示例,展示了Scheduler.resumeJob()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.resumeJob()
方法的具体详情如下:
包路径:org.quartz.Scheduler
类名称:Scheduler
方法名:resumeJob
[英]Resume (un-pause) the org.quartz.JobDetail
with the given name.
If any of the Job
'sTrigger
s missed one or more fire-times, then the Trigger
's misfire instruction will be applied.
[中]恢复(取消暂停)具有给定名称的org.quartz.JobDetail
。
如果任何[$1$]Trigger
的Trigger
错过了一次或多次点火,则Trigger
的失火指令将被应用。
代码示例来源:origin: wuyouzhuguli/FEBS-Shiro
/**
* 恢复任务
*/
public static void resumeJob(Scheduler scheduler, Long jobId) {
try {
scheduler.resumeJob(getJobKey(jobId));
} catch (SchedulerException e) {
log.error("恢复定时任务失败", e);
}
}
代码示例来源:origin: azkaban/azkaban
/**
* resume a paused job given the groupname. since resuming request might be issued concurrently,
* so synchronized is added to ensure thread safety.
*/
public synchronized void resumeJob(final String jobName, final String groupName)
throws SchedulerException {
checkJobExistence(jobName, groupName);
this.scheduler.resumeJob(new JobKey(jobName, groupName));
}
代码示例来源:origin: javamelody/javamelody
void resumeJob(JobDetail jobDetail, Scheduler scheduler) throws SchedulerException {
scheduler.resumeJob(jobDetail.getName(), jobDetail.getGroup());
}
}
代码示例来源:origin: Dreampie/Resty
/**
* 恢复任务
*/
public void resume() {
long id = quartzKey.getId();
String name = quartzKey.getName();
String group = quartzKey.getGroup();
SchedulerFactory factory = Quartzer.getSchedulerFactory();
try {
if (factory != null) {
Scheduler scheduler = factory.getScheduler();
TriggerKey triggerKey = TriggerKey.triggerKey(TRIGGER_MARK + SEPARATOR + name + SEPARATOR + id, GROUP_MARK + SEPARATOR + group + SEPARATOR + id);
Trigger trigger = scheduler.getTrigger(triggerKey);
if (trigger != null) {
scheduler.resumeJob(trigger.getJobKey());
}
}
} catch (Exception e) {
throw new QuartzException("Can't resume job.", e);
}
}
代码示例来源:origin: Exrick/x-boot
@RequestMapping(value = "/resume",method = RequestMethod.POST)
@ApiOperation(value = "恢复定时任务")
public Result<Object> resumeJob(@ModelAttribute QuartzJob job){
try {
scheduler.resumeJob(JobKey.jobKey(job.getJobClassName()));
} catch (SchedulerException e) {
throw new XbootException("恢复定时任务失败");
}
job.setStatus(CommonConstant.STATUS_NORMAL);
quartzJobService.update(job);
return new ResultUtil<Object>().setSuccessMsg("恢复定时任务成功");
}
代码示例来源:origin: bill1012/AdminEAP
/**
* 恢复运行
*/
public void resumeJob(ScheduleJob scheduleJob) throws SchedulerException {
Scheduler scheduler = schedulerFactoryBean.getScheduler();
JobKey jobKey = JobKey.jobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup());
scheduler.resumeJob(jobKey);
}
代码示例来源:origin: sanluan/PublicCMS
/**
* 恢复任务计划
*
* @param site
* @param id
*/
public void resume(SysSite site, Integer id) {
if (CommonUtils.notEmpty(id)) {
Date startTime = CommonUtils.getDate();
try {
scheduler.resumeJob(JobKey.jobKey(getTaskName(id)));
} catch (SchedulerException e) {
sysTaskService.updateStatus(id, TASK_STATUS_ERROR);
logTaskService.save(new LogTask(site.getId(), id, startTime, CommonUtils.getDate(), false, e.getMessage()));
}
}
}
代码示例来源:origin: sanluan/PublicCMS
/**
* 恢复任务计划
*
* @param site
* @param id
*/
public void resume(SysSite site, Integer id) {
if (CommonUtils.notEmpty(id)) {
Date startTime = CommonUtils.getDate();
try {
scheduler.resumeJob(JobKey.jobKey(getTaskName(id)));
} catch (SchedulerException e) {
sysTaskService.updateStatus(id, TASK_STATUS_ERROR);
logTaskService.save(new LogTask(site.getId(), id, startTime, CommonUtils.getDate(), false, e.getMessage()));
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* resume a job with the given jobId assuming the job is in the default quartz group
*/
@Override
public void resumeJob(String jobId) {
try {
sched.resumeJob(jobKey(jobId, Scheduler.DEFAULT_GROUP));
} catch (SchedulerException se) {
log.error("failed to pause a job with id={}: {}", jobId, se.getMessage());
log.debug("Exception", se);
}
}
代码示例来源:origin: qaprosoft/zafira
public void resumeJob(long id)
{
try
{
springScheduler.getScheduler().resumeJob(findJobKey(String.valueOf(id)));
} catch (SchedulerException e)
{
LOGGER.error("Can't delete job");
}
}
代码示例来源:origin: juliuskrah/quartz-manager
public void resumeJob(String group, String name) {
try {
scheduler.resumeJob(jobKey(name, group));
log.info("Resumed job with key - {}.{}", group, name);
} catch (SchedulerException e) {
log.error("Could not resume job with key - {}.{} due to error - {}", group, name, e.getLocalizedMessage());
}
}
}
代码示例来源:origin: yzcheng90/X-SpringBoot
/**
* 恢复任务
*/
public static void resumeJob(Scheduler scheduler, Long jobId) {
try {
scheduler.resumeJob(getJobKey(jobId));
} catch (SchedulerException e) {
throw new RRException("暂停定时任务失败", e);
}
}
代码示例来源:origin: muyinchen/migo-security
/**
* 恢复任务
*/
public static void resumeJob(Scheduler scheduler, Long jobId) {
try {
scheduler.resumeJob(getJobKey(jobId));
} catch (SchedulerException e) {
throw new RRException("暂停定时任务失败", e);
}
}
代码示例来源:origin: zhaoqicheng/renren-fast
/**
* 恢复任务
*/
public static void resumeJob(Scheduler scheduler, Long jobId) {
try {
scheduler.resumeJob(getJobKey(jobId));
} catch (SchedulerException e) {
throw new RRException("暂停定时任务失败", e);
}
}
代码示例来源:origin: yjjdick/sdb-mall
/**
* 恢复任务
*/
public static void resumeJob(Scheduler scheduler, Long jobId) {
try {
scheduler.resumeJob(getJobKey(jobId));
} catch (SchedulerException e) {
throw new RRException("暂停定时任务失败", e);
}
}
代码示例来源:origin: xkcoding/spring-boot-demo
/**
* 恢复定时任务
*
* @param form 表单参数 {@link JobForm}
* @throws SchedulerException 异常
*/
@Override
public void resumeJob(JobForm form) throws SchedulerException {
scheduler.resumeJob(JobKey.jobKey(form.getJobClassName(), form.getJobGroupName()));
}
代码示例来源:origin: com.threewks.thundr/thundr-contrib-quartz
@Override
public void resumeJob(JobKey jobKey) throws QuartzException {
try {
delegate.resumeJob(jobKey);
} catch (SchedulerException e) {
Logger.error(e.getMessage());
throw new QuartzException(e);
}
}
代码示例来源:origin: com.gitblit.fathom/fathom-quartz
public void resumeJob(JobInfo jobInfo) {
try {
scheduler.resumeJob(JobKey.jobKey(jobInfo.getName(), jobInfo.getGroup()));
} catch (SchedulerException e) {
throw new FathomException("Failed to resume job {}", jobInfo.getFullName(), e);
}
}
代码示例来源:origin: pentaho/pentaho-platform
/** {@inheritDoc} */
public void resumeJob( String jobId ) throws SchedulerException {
try {
Scheduler scheduler = getQuartzScheduler();
scheduler.resumeJob( jobId, QuartzJobKey.parse( jobId ).getUserName() );
} catch ( org.quartz.SchedulerException e ) {
throw new SchedulerException( Messages.getInstance().getString(
"QuartzScheduler.ERROR_0005_FAILED_TO_RESUME_JOBS" ), e ); //$NON-NLS-1$
}
}
代码示例来源:origin: xiaolongzuo/niubi-job
private void resumeJob(JobKey jobKey) {
try {
scheduler.resumeJob(jobKey);
LoggerHelper.info("job [" + jobKey.getGroup() + "," + jobKey.getName() + "] has been resumed.");
} catch (SchedulerException e) {
LoggerHelper.error("resume [" + jobKey.getGroup() + "," + jobKey.getName() + "] job failed.", e);
throw new NiubiException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!