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

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

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

Scheduler.addGlobalJobListener介绍

[英]Add the given JobListener to the Scheduler's global list.

Listeners in the 'global' list receive notification of execution events for ALL org.quartz.JobDetails.
[中]将给定的JobListener添加到Scheduler的全局列表中。
“全局”列表中的侦听器接收所有org.quartz.JobDetail的执行事件通知。

代码示例

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

public void addGlobalJobListener(JobListener jobGlobalListener) throws SchedulerException {
  final Scheduler defaultScheduler;
  if (Parameter.QUARTZ_DEFAULT_LISTENER_DISABLED.getValueAsBoolean()) {
    defaultScheduler = null;
    LOG.debug("Initialization of Quartz default listener has been disabled");
  } else {
    defaultScheduler = StdSchedulerFactory.getDefaultScheduler();
    defaultScheduler.addGlobalJobListener(jobGlobalListener);
  }
  for (final Scheduler scheduler : JobInformations.getAllSchedulers()) {
    if (scheduler != defaultScheduler) {
      scheduler.addGlobalJobListener(jobGlobalListener);
    }
  }
}

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

public void addGlobalJobListener(JobListener jobListener) throws SchedulerException {
  scheduler.addGlobalJobListener(jobListener);
}

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

public void addGlobalJobListener(JobListener jobListener) throws SchedulerException {
  this.scheduler.addGlobalJobListener(jobListener);
}

代码示例来源:origin: com.opensymphony.quartz/com.springsource.org.quartz

/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String name, Scheduler scheduler)
  throws SchedulerException {
  this.name = name;
  scheduler.addGlobalJobListener(this);
}

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

/**
 * <p>
 * Called during creation of the <code>Scheduler</code> in order to give
 * the <code>SchedulerPlugin</code> a chance to initialize.
 * </p>
 * 
 * @throws SchedulerConfigException
 *           if there is an error initializing.
 */
public void initialize(String name, Scheduler scheduler)
  throws SchedulerException {
  this.name = name;
  scheduler.addGlobalJobListener(this);
}

代码示例来源:origin: net.bull.javamelody/javamelody-core

public void addGlobalJobListener(JobListener jobGlobalListener) throws SchedulerException {
  final Scheduler defaultScheduler;
  if (Parameter.QUARTZ_DEFAULT_LISTENER_DISABLED.getValueAsBoolean()) {
    defaultScheduler = null;
    LOG.debug("Initialization of Quartz default listener has been disabled");
  } else {
    defaultScheduler = StdSchedulerFactory.getDefaultScheduler();
    defaultScheduler.addGlobalJobListener(jobGlobalListener);
  }
  for (final Scheduler scheduler : JobInformations.getAllSchedulers()) {
    if (scheduler != defaultScheduler) {
      scheduler.addGlobalJobListener(jobGlobalListener);
    }
  }
}

代码示例来源:origin: org.kuali.kfs/kfs-core

/**
 * @see org.kuali.kfs.sys.batch.service.SchedulerService#initialize()
 */
public void initialize() {
  LOG.info("Initializing the schedule");
  jobListener.setSchedulerService(this);
  try {
    scheduler.addGlobalJobListener(jobListener);
  } catch (SchedulerException e) {
    throw new RuntimeException("SchedulerServiceImpl encountered an exception when trying to register the global job listener", e);
  }
  for (ModuleService moduleService : kualiModuleService.getInstalledModuleServices()) {
    initializeJobsForModule(moduleService);
    initializeTriggersForModule(moduleService);
  }
}
/**

代码示例来源:origin: org.appspy.admin/org.appspy.admin.service.impl

public void afterPropertiesSet() throws Exception
  mScheduler.addGlobalJobListener(new JobListener(){

代码示例来源:origin: org.apache.kalumet/org.apache.kalumet.agent

scheduler.addGlobalJobListener( new SchedulerJobListener() );
LOGGER.debug( "Scheduler job listener plugged" );
scheduler.start();

代码示例来源:origin: com.xpn.xwiki.platform.plugins/xwiki-plugin-scheduler

/**
 * Associates the scheduler with a StatusListener
 * 
 * @throws SchedulerPluginException if the status listener failed to be set properly
 */
private void setStatusListener() throws SchedulerPluginException
{
  StatusListener listener = new StatusListener();
  try {
    getScheduler().addSchedulerListener(listener);
    getScheduler().addGlobalJobListener(listener);
  } catch (SchedulerException e) {
    throw new SchedulerPluginException(
      SchedulerPluginException.ERROR_SCHEDULERPLUGIN_INITIALIZE_STATUS_LISTENER,
      "Error while initializing the status listener", e);
  }
}

相关文章