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

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

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

Scheduler.getCalendarNames介绍

[英]Get the names of all registered Calendars.
[中]获取所有注册Calendars的名称。

代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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

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

代码示例来源:origin: OpenNMS/opennms

private void printCurrentSchedule() {
  try {
    LOG.info("calendarNames: {}", String.join(", ", getScheduler().getCalendarNames().toArray(new String[0])));
    LOG.info("current executing jobs: {}", StringUtils.arrayToCommaDelimitedString(getScheduler().getCurrentlyExecutingJobs().toArray()));
    LOG.info("current job names: {}", getScheduler().getJobKeys(GroupMatcher.<JobKey>groupEquals(JOB_GROUP)).stream().map(JobKey::getName).collect(Collectors.joining(", ")));

代码示例来源:origin: OpenNMS/opennms

private void printCurrentSchedule() {
    
    try {
      LOG.info("calendarNames: {}", String.join(", ", getScheduler().getCalendarNames().toArray(new String[0])));
      LOG.info("current executing jobs: {}", StringUtils.arrayToCommaDelimitedString(getScheduler().getCurrentlyExecutingJobs().toArray()));
      LOG.info("current job names: {}", getScheduler().getJobKeys(GroupMatcher.<JobKey>groupEquals(JOB_GROUP)).stream().map(JobKey::getName).collect(Collectors.joining(", ")));
      LOG.info("scheduler metadata: {}", getScheduler().getMetaData());
      LOG.info("trigger names: {}", getScheduler().getTriggerKeys(GroupMatcher.<TriggerKey>groupEquals(JOB_GROUP)).stream().map(TriggerKey::getName).collect(Collectors.joining(", ")));
      
      for (TriggerKey key : getScheduler().getTriggerKeys(GroupMatcher.<TriggerKey>groupEquals(JOB_GROUP))) {
        String triggerName = key.getName();
        CronTrigger t = (CronTrigger) getScheduler().getTrigger(key);
        LOG.info("trigger: {}, calendar name: {}, cron expression: {}, URL: {}, rescanExisting: {}, next fire time: {}, previous fire time: {}, time zone: {}, priority: {}",
             triggerName,
             t.getCalendarName(),
             t.getCronExpression(),
             t.getJobDataMap().get(ImportJob.URL),
             t.getJobDataMap().get(ImportJob.RESCAN_EXISTING),
             t.getNextFireTime(),
             t.getPreviousFireTime(),
             t.getTimeZone(),
             t.getPriority());
      }
      
    } catch (Throwable e) {
      LOG.error("printCurrentSchedule: {}", e.getLocalizedMessage(), e);
    }
    
  }
}

代码示例来源:origin: org.opennms/opennms-provisiond

private void printCurrentSchedule() {
    
    try {
      LOG.info("calendarNames: {}", String.join(", ", getScheduler().getCalendarNames().toArray(new String[0])));
      LOG.info("current executing jobs: {}", StringUtils.arrayToCommaDelimitedString(getScheduler().getCurrentlyExecutingJobs().toArray()));
      LOG.info("current job names: {}", getScheduler().getJobKeys(GroupMatcher.<JobKey>groupEquals(JOB_GROUP)).stream().map(JobKey::getName).collect(Collectors.joining(", ")));
      LOG.info("scheduler metadata: {}", getScheduler().getMetaData());
      LOG.info("trigger names: {}", getScheduler().getTriggerKeys(GroupMatcher.<TriggerKey>groupEquals(JOB_GROUP)).stream().map(TriggerKey::getName).collect(Collectors.joining(", ")));
      
      for (TriggerKey key : getScheduler().getTriggerKeys(GroupMatcher.<TriggerKey>groupEquals(JOB_GROUP))) {
        String triggerName = key.getName();
        CronTrigger t = (CronTrigger) getScheduler().getTrigger(key);
        LOG.info("trigger: {}, calendar name: {}, cron expression: {}, URL: {}, rescanExisting: {}, next fire time: {}, previous fire time: {}, time zone: {}, priority: {}",
             triggerName,
             t.getCalendarName(),
             t.getCronExpression(),
             t.getJobDataMap().get(ImportJob.URL),
             t.getJobDataMap().get(ImportJob.RESCAN_EXISTING),
             t.getNextFireTime(),
             t.getPreviousFireTime(),
             t.getTimeZone(),
             t.getPriority());
      }
      
    } catch (Throwable e) {
      LOG.error("printCurrentSchedule: {}", e.getLocalizedMessage(), e);
    }
    
  }
}

相关文章