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

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

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

Scheduler.getTriggerGroupNames介绍

[英]Get the names of all known Trigger groups.
[中]获取所有已知Trigger组的名称。

代码示例

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

if(group.equals("*")) {
  log.info("Deleting all triggers in ALL groups.");
  for (String groupName : scheduler.getTriggerGroupNames()) {
    if (!triggerGroupsToNeverDelete.contains(groupName)) {
      for (TriggerKey key : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(groupName))) {

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

if(group.equals("*")) {
  log.info("Deleting all triggers in ALL groups.");
  for (String groupName : scheduler.getTriggerGroupNames()) {
    if (!triggerGroupsToNeverDelete.contains(groupName)) {
      for (TriggerKey key : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(groupName))) {

代码示例来源:origin: org.rhq/rhq-enterprise-server

public String[] getTriggerGroupNames() throws SchedulerException {
  return this.scheduler.getTriggerGroupNames();
}

代码示例来源:origin: org.rhq/rhq-enterprise-server

public String[] getTriggerGroupNames() throws SchedulerException {
  return scheduler.getTriggerGroupNames();
}

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

public List<String> getTriggerGroupNames() {
  try {
    return scheduler.getTriggerGroupNames();
  } catch (final SchedulerException e) {
    throw new QuartzSchedulerException(e);
  }
}

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

public List<String> getTriggerGroupNames() {
  try {
    return scheduler.getTriggerGroupNames();
  } catch (SchedulerException e) {
    throw new QuartzRuntimeException(e);
  }
}

代码示例来源:origin: OpenWiseSolutions/openhub-framework

@Override
public List<String> getTriggerGroupNames() throws SchedulerException {
  return getScheduler().getTriggerGroupNames();
}

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

public static List<Trigger> getTriggers() throws SchedulerException {
    Scheduler sched = StdSchedulerFactory.getDefaultScheduler();
    List<String> triggerGroups = sched.getTriggerGroupNames();
    List<Trigger> triggers = new ArrayList<Trigger>();

    for (int i = 0; i < triggerGroups.size(); i++) {
      String name = triggerGroups.get(i);
      Set<TriggerKey> keys = sched.getTriggerKeys(GroupMatcher
          .triggerGroupEquals(name));
      Iterator<TriggerKey> iter = keys.iterator();

      while (iter.hasNext()) {
        triggers.add(sched.getTrigger(iter.next()));
      }
    }

    return triggers;
  }
}

代码示例来源:origin: metatron-app/metatron-discovery

/**
 * Find all scheduling Jobs
 *
 * @return
 */
@RequestMapping(value = "/jobs", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> findAll() throws SchedulerException {
 List<SchedulingJob> schedulingJobs = Lists.newArrayList();
 for (String groupName : scheduler.getTriggerGroupNames()) {
  for (TriggerKey key : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(groupName))) {
   Trigger trigger = scheduler.getTrigger(key);
   schedulingJobs.add(new SchedulingJob(trigger, scheduler.getTriggerState(key)));
  }
 }
 return ResponseEntity.ok(schedulingJobs);
}

代码示例来源:origin: pl.edu.icm.sedno/sedno-tools

private List<Trigger> getAllTriggers() {
  
  List<Trigger> triggers = Lists.newArrayList();
  
  try {
    for (String triggerGroup : getScheduler().getTriggerGroupNames()) {
      for (String triggerName : getScheduler().getTriggerNames(triggerGroup)) {
        triggers.add(getScheduler().getTrigger(triggerName, triggerGroup));
      }
    }
  }catch (SchedulerException e) {
    throw new RuntimeException(e);
  }        
    
  Collections.sort(triggers);
  
  return triggers;	
}

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

public List<Trigger> getAllTriggers() {
  try {
    List<Trigger> triggers = new ArrayList<Trigger>();
    List<String> groups = scheduler.getTriggerGroupNames();
    for (String group : groups) {
      Set<TriggerKey> keys = scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(group));
      for (TriggerKey key : keys) {
        Trigger trigger = scheduler.getTrigger(key);
        triggers.add(trigger);
      }
    }
    return triggers;
  } catch (SchedulerException e) {
    throw new QuartzRuntimeException(e);
  }
}

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

@Override
public List<String> getTriggerGroupNames() throws QuartzException {
  try {
    return delegate.getTriggerGroupNames();
  } catch (SchedulerException e) {
    Logger.error(e.getMessage());
    throw new QuartzException(e);
  }
}

代码示例来源:origin: metatron-app/metatron-discovery

/**
 * Find by key
 *
 * @return
 */
@RequestMapping(value = "/jobs/search/key", method = RequestMethod.GET, produces = "application/json")
public ResponseEntity<?> findByKey(@RequestParam(name = "group") String group,
                  @RequestParam(name = "name", required = false) String name) throws SchedulerException {
 if (StringUtils.isNotEmpty(name)) {
  TriggerKey triggerKey = new TriggerKey(name, group);
  Trigger trigger = scheduler.getTrigger(triggerKey);
  if (trigger == null) {
   return ResponseEntity.ok(Lists.newArrayList());
  }
  return ResponseEntity.ok(Lists.newArrayList(new SchedulingJob(trigger, scheduler.getTriggerState(triggerKey))));
 }
 List<SchedulingJob> schedulingJobs = Lists.newArrayList();
 for (String groupName : scheduler.getTriggerGroupNames()) {
  if (group.equals(groupName)) {
   for (TriggerKey key : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(groupName))) {
    Trigger trigger = scheduler.getTrigger(key);
    schedulingJobs.add(new SchedulingJob(trigger, scheduler.getTriggerState(key)));
   }
   break;
  }
 }
 return ResponseEntity.ok(schedulingJobs);
}

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

@Override
public List<String> getTriggerGroupNames() throws QuartzException {
  try {
    return delegate.getTriggerGroupNames();
  } catch (SchedulerException e) {
    Logger.error(e.getMessage());
    throw new QuartzException(e);
  }
}

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

public List<Trigger> getPausedTriggers() {
  try {
    List<Trigger> result = new ArrayList<Trigger>();
    List<String> groups = scheduler.getTriggerGroupNames();
    for (String group : groups) {
      Set<TriggerKey> triggerKeys = scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(group));
      for (TriggerKey key : triggerKeys) {
        if (scheduler.getTriggerState(key) == TriggerState.PAUSED) {
          result.add(scheduler.getTrigger(key));
        }
      }
    }
    return result;
  } catch (SchedulerException e) {
    throw new QuartzRuntimeException(e);
  }
}

代码示例来源:origin: yejq/quartz-spring-manager

/**
 * 启动定时器 如果xml配置文件中的description中,是以$paused_flag
 * 结尾的,表示这个trigger是暂停状态,不需要resume. 其它的trigger全部resume.
 */
public static void startupScheduler(Scheduler scheduler) throws SchedulerException {
  scheduler.pauseAll();
  scheduler.start();
  String[] triggerGroups = scheduler.getTriggerGroupNames();
  for (int i = 0; i < triggerGroups.length; i++) {
    String[] triggersInGroup = scheduler.getTriggerNames(triggerGroups[i]);
    for (int j = 0; j < triggersInGroup.length; j++) {
      Trigger t = scheduler.getTrigger(triggersInGroup[j], triggerGroups[i]);
      if (t.getDescription() == null || !t.getDescription().endsWith(PAUSED_FLAG)) {
        scheduler.resumeTrigger(triggersInGroup[j], triggerGroups[i]);
      }
    }
  }
}

代码示例来源:origin: yejq/quartz-spring-manager

return mv;
triggerGroups = scheduler.getTriggerGroupNames();

代码示例来源:origin: bonitasoft/bonita-engine

@Override
public void rescheduleErroneousTriggers() throws SSchedulerException {
  checkSchedulerState();
  try {
    final List<String> triggerGroupNames = scheduler.getTriggerGroupNames();
    for (final String triggerGroupName : triggerGroupNames) {
      for (final TriggerKey triggerKey : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(triggerGroupName))) {
        if (TriggerState.ERROR.equals(scheduler.getTriggerState(triggerKey))) {
          scheduler.pauseTrigger(triggerKey);
          scheduler.resumeTrigger(triggerKey);
        }
      }
    }
  } catch (final SchedulerException e) {
    throw new SSchedulerException(e);
  }
}

代码示例来源:origin: bonitasoft/bonita-engine

@Override
public void rescheduleErroneousTriggers() throws SSchedulerException {
  checkSchedulerState();
  try {
    final List<String> triggerGroupNames = scheduler.getTriggerGroupNames();
    for (final String triggerGroupName : triggerGroupNames) {
      for (final TriggerKey triggerKey : scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(triggerGroupName))) {
        if (TriggerState.ERROR.equals(scheduler.getTriggerState(triggerKey))) {
          scheduler.pauseTrigger(triggerKey);
          scheduler.resumeTrigger(triggerKey);
        }
      }
    }
  } catch (final SchedulerException e) {
    throw new SSchedulerException(e);
  }
}

代码示例来源:origin: com.helger/ph-webctrls

for (final String sTriggerGroupName : aScheduler.getTriggerGroupNames ())
 for (final TriggerKey aTriggerKey : aScheduler.getTriggerKeys (GroupMatcher.triggerGroupEquals (sTriggerGroupName)))

相关文章