org.quartz.Scheduler.getTriggersOfJob()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(201)

本文整理了Java中org.quartz.Scheduler.getTriggersOfJob()方法的一些代码示例,展示了Scheduler.getTriggersOfJob()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler.getTriggersOfJob()方法的具体详情如下:
包路径:org.quartz.Scheduler
类名称:Scheduler
方法名:getTriggersOfJob

Scheduler.getTriggersOfJob介绍

[英]Get all Trigger s that are associated with the identified org.quartz.JobDetail.
[中]获取与标识的org.quartz.JobDetail关联的所有Trigger

代码示例

代码示例来源:origin: javamelody/javamelody

List<Trigger> getTriggersOfJob(JobDetail jobDetail, Scheduler scheduler)
    throws SchedulerException {
  return Arrays.asList(scheduler.getTriggersOfJob(jobDetail.getName(), jobDetail.getGroup()));
}

代码示例来源:origin: kairosdb/kairosdb

List<Trigger> triggers = (List<Trigger>) scheduler.getTriggersOfJob(jobKey);
Date nextFireTime = triggers.get(0).getNextFireTime();
log.info("*** Scheduled job " + jobName + " to execute next on " + nextFireTime);

代码示例来源:origin: azkaban/azkaban

.get(FlowTriggerQuartzJob.FLOW_TRIGGER);
final String submitUser = jobDataMap.getString(FlowTriggerQuartzJob.SUBMIT_USER);
final List<? extends Trigger> quartzTriggers = quartzScheduler.getTriggersOfJob(jobKey);
final boolean isPaused = this.scheduler
  .isJobPaused(FlowTriggerQuartzJob.JOB_NAME, groupName);

代码示例来源:origin: azkaban/azkaban

public synchronized boolean isJobPaused(final String jobName, final String groupName)
  throws SchedulerException {
 final JobKey jobKey = new JobKey(jobName, groupName);
 final JobDetail jobDetail = this.scheduler.getJobDetail(jobKey);
 final List<? extends Trigger> triggers = this.scheduler.getTriggersOfJob(jobDetail.getKey());
 for (final Trigger trigger : triggers) {
  final TriggerState triggerState = this.scheduler.getTriggerState(trigger.getKey());
  if (TriggerState.PAUSED.equals(triggerState)) {
   return true;
  }
 }
 return false;
}

代码示例来源:origin: quartz-scheduler/quartz

(sched.getTriggersOfJob(
  detail.getKey()).size() == 0))) {
throw new SchedulerException(

代码示例来源:origin: quartz-scheduler/quartz

(sched.getTriggersOfJob(
  detail.getKey()).size() == 0))) {
throw new SchedulerException(

代码示例来源:origin: com.blazebit/blaze-quartz-utils

@SuppressWarnings("unchecked")
public static List<Trigger> getTriggers(Scheduler sched, JobKey key)
    throws SchedulerException {
  return (List<Trigger>) sched.getTriggersOfJob(key);
}

代码示例来源:origin: bill1012/AdminEAP

List<ScheduleJob> jobList = new ArrayList<ScheduleJob>();
for (JobKey jobKey : jobKeys) {
  List<? extends Trigger> triggers = scheduler.getTriggersOfJob(jobKey);
  for (Trigger trigger : triggers) {
    ScheduleJob job = new ScheduleJob();

代码示例来源:origin: bill1012/AdminEAP

Scheduler scheduler = schedulerFactoryBean.getScheduler();
JobKey jobKey = new JobKey(scheduleJob.getJobName(), scheduleJob.getJobGroup());
List<? extends Trigger> triggers = scheduler.getTriggersOfJob(jobKey);
List<ScheduleJob> jobList = new ArrayList<ScheduleJob>();
for (Trigger trigger : triggers) {

代码示例来源:origin: myschedule/myschedule-quartz-extra

public List<? extends Trigger> getTriggersOfJob(JobKey jobKey) {
  try {
    return scheduler.getTriggersOfJob(jobKey);
  } catch (SchedulerException e) {
    throw new QuartzRuntimeException(e);
  }
}

代码示例来源:origin: org.codelibs/elasticsearch-quartz

public List<? extends Trigger> getTriggersOfJob(final JobKey jobKey) {
  try {
    return scheduler.getTriggersOfJob(jobKey);
  } catch (final SchedulerException e) {
    throw new QuartzSchedulerException(e);
  }
}

代码示例来源:origin: org.exoplatform.kernel/exo.kernel.component.common

public Trigger[] getTriggersOfJob(String jobName, String groupName) throws Exception
{
 List<? extends Trigger> triggers = scheduler_.getTriggersOfJob(JobKey.jobKey(jobName, getGroupName(groupName)));
 Trigger[] aTriggers = new Trigger[triggers.size()];
 return (Trigger[])triggers.toArray(aTriggers);
}

代码示例来源:origin: apache/incubator-griffin

List<? extends Trigger> getTriggers(String name, String group) throws
  SchedulerException {
  if (name == null || group == null) {
    return null;
  }
  JobKey jobKey = new JobKey(name, group);
  Scheduler scheduler = factory.getScheduler();
  return scheduler.getTriggersOfJob(jobKey);
}

代码示例来源:origin: robeio/robe

public boolean isScheduledJob(String name, String group) throws SchedulerException {
  List<? extends Trigger> triggers = scheduler.getTriggersOfJob(JobKey.jobKey(name, group));
  for (Trigger t : triggers) {
    if (t.getNextFireTime() != null) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.threewks.thundr/thundr-contrib-quartz

@Override
public List<? extends Trigger> getTriggersOfJob(JobKey jobKey) throws QuartzException {
  try {
    return delegate.getTriggersOfJob(jobKey);
  } catch (SchedulerException e) {
    Logger.error(e.getMessage());
    throw new QuartzException(e);
  }
}

代码示例来源:origin: com.atlassian.scheduler/atlassian-scheduler-quartz1

Trigger[] getTriggersOfJob(final JobRunnerKey jobRunnerKey) {
  try {
    return getScheduler().getTriggersOfJob(jobRunnerKey.toString(), QUARTZ_JOB_GROUP);
  } catch (SchedulerException se) {
    throw unchecked("Could not get the triggers from Quartz", se);
  }
}

代码示例来源:origin: org.motechproject/motech-scheduler

private String getJobStatus(JobKey jobKey) throws SchedulerException {
  TriggerKey triggerKey = scheduler.getTriggersOfJob(jobKey).get(0).getKey();
  if (scheduler.getTriggerState(triggerKey) == Trigger.TriggerState.ERROR) {
    return JobBasicInfo.STATUS_ERROR;
  } else if (scheduler.getTriggerState(triggerKey) == Trigger.TriggerState.BLOCKED) {
    return JobBasicInfo.STATUS_BLOCKED;
  } else if (scheduler.getTriggerState(triggerKey) == Trigger.TriggerState.PAUSED) {
    return JobBasicInfo.STATUS_PAUSED;
  } else {
    return JobBasicInfo.STATUS_OK;
  }
}

代码示例来源:origin: robeio/robe

public boolean isPausedJob(String name, String group) throws SchedulerException {
  List<? extends Trigger> triggers = scheduler.getTriggersOfJob(JobKey.jobKey(name, group));
  for (Trigger t : triggers) {
    if (!scheduler.getTriggerState(t.getKey()).equals(Trigger.TriggerState.PAUSED)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: Evolveum/midpoint

private void deleteRedirectTriggers(@NotNull String oid) throws SchedulerException {
    LOGGER.trace("Going to remove obsolete redirect triggers");
    Scheduler scheduler = taskManager.getExecutionManager().getQuartzScheduler();
    List<? extends Trigger> existingTriggers = scheduler.getTriggersOfJob(TaskQuartzImplUtil.createJobKeyForTaskOid(oid));
    for (Trigger trigger : existingTriggers) {
      if (trigger.getJobDataMap().containsKey(REDIRECT_FLAG)) {
        LOGGER.trace("Removing obsolete redirect trigger {}", trigger);
        scheduler.unscheduleJob(trigger.getKey());
      }
    }
  }
}

代码示例来源:origin: cdapio/cdap

private void verifyJobAndTriggers(JobKey jobKey, int expectedTriggersSize,
                 Trigger.TriggerState expectedTriggerState) throws SchedulerException {
 JobDetail jobStored = scheduler.getJobDetail(jobKey);
 List<? extends Trigger> triggers = scheduler.getTriggersOfJob(jobKey);
 Assert.assertEquals(jobStored.getKey().getName(), jobKey.getName());
 Assert.assertEquals(expectedTriggersSize, triggers.size());
 verifyTriggerState(triggers, expectedTriggerState);
}

相关文章