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

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

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

Scheduler.shutdown介绍

[英]Halts the Scheduler's firing of Triggers, and cleans up all resources associated with the Scheduler. Equivalent to shutdown(false).

The scheduler cannot be re-started.
[中]停止SchedulerTriggers的触发,并清理与调度程序关联的所有资源。相当于shutdown(false)
无法重新启动计划程序。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Shut down the Quartz scheduler on bean factory shutdown,
 * stopping all scheduled jobs.
 */
@Override
public void destroy() throws SchedulerException {
  if (this.scheduler != null) {
    logger.info("Shutting down Quartz Scheduler");
    this.scheduler.shutdown(this.waitForJobsToCompleteOnShutdown);
  }
}

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

@Override protected void shutDown() throws SchedulerException  {
  this.scheduler.shutdown(this.waitForJobCompletion);
 }
}

代码示例来源:origin: org.springframework/spring-context-support

/**
 * Shut down the Quartz scheduler on bean factory shutdown,
 * stopping all scheduled jobs.
 */
@Override
public void destroy() throws SchedulerException {
  if (this.scheduler != null) {
    logger.info("Shutting down Quartz Scheduler");
    this.scheduler.shutdown(this.waitForJobsToCompleteOnShutdown);
  }
}

代码示例来源:origin: Netflix/Priam

public void shutdown() {
  try {
    scheduler.shutdown();
  } catch (SchedulerException e) {
    throw new RuntimeException(e);
  }
}

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

public void shutdown() {
 logger.info("Shutting down scheduler");
 try {
  this.scheduler.shutdown();
 } catch (final SchedulerException e) {
  logger.error("Exception shutting down scheduler: ", e);
 }
}

代码示例来源:origin: kiegroup/jbpm

public void forceShutdown() {
  if (scheduler != null) {
    try {
      scheduler.shutdown();
      timerServiceCounter.set(0);
    } catch (SchedulerException e) {
      logger.warn("Error encountered while shutting down (forced) the scheduler", e);
    }
    scheduler = null;
  }
}

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

@Override
public void stop()
{
  try
  {
    scheduler.shutdown(true);
  }
  catch (SchedulerException e)
  {
    log.error("Failed to start " + getClass().getName(), e);
  }
}

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

public void contextDestroyed(ServletContextEvent sce) {
  if (!performShutdown) {
    return;
  }
  try {
    if (scheduler != null) {
      scheduler.shutdown(waitOnShutdown);
    }
  } catch (Exception e) {
    log.error("Quartz Scheduler failed to shutdown cleanly: " + e.toString());
    e.printStackTrace();
  }
  log.info("Quartz Scheduler successful shutdown.");
}

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

public void contextDestroyed(ServletContextEvent sce) {
  if (!performShutdown) {
    return;
  }
  try {
    if (scheduler != null) {
      scheduler.shutdown(waitOnShutdown);
    }
  } catch (Exception e) {
    log.error("Quartz Scheduler failed to shutdown cleanly: " + e.toString());
    e.printStackTrace();
  }
  log.info("Quartz Scheduler successful shutdown.");
}

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

@Override
public void destroy() {
  if (!performShutdown) {
    return;
  }
  try {
    if (scheduler != null) {
      scheduler.shutdown(waitOnShutdown);
    }
  } catch (Exception e) {
    log("Quartz Scheduler failed to shutdown cleanly: " + e.toString());
    e.printStackTrace();
  }
  log("Quartz Scheduler successful shutdown.");
}

代码示例来源:origin: Netflix/Priam

@Override
public void contextDestroyed(ServletContextEvent servletContextEvent) {
  try {
    for (Scheduler scheduler :
        injector.getInstance(SchedulerFactory.class).getAllSchedulers()) {
      scheduler.shutdown();
    }
  } catch (SchedulerException e) {
    throw new RuntimeException(e);
  }
  super.contextDestroyed(servletContextEvent);
}

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

@Override
public void destroy() {
  if (!performShutdown) {
    return;
  }
  try {
    if (scheduler != null) {
      scheduler.shutdown(waitOnShutdown);
    }
  } catch (Exception e) {
    log("Quartz Scheduler failed to shutdown cleanly: " + e.toString());
    e.printStackTrace();
  }
  log("Quartz Scheduler successful shutdown.");
}

代码示例来源:origin: elasticjob/elastic-job-lite

/**
   * 关闭调度器.
   */
  public synchronized void shutdown() {
    try {
      if (!scheduler.isShutdown()) {
        scheduler.shutdown();
      }
    } catch (final SchedulerException ex) {
      throw new JobSystemException(ex);
    }
  }
}

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

@Override
public void stopService() throws Exception {
  log.info("Stop QuartzService(" + jndiName + ")...");
  try {
    Scheduler scheduler = schedulerFactory.getScheduler();
    scheduler.shutdown();
  } catch (Exception e) {
    log.error("Failed to shutdown Scheduler", e);
    throw new SchedulerConfigException(
        "Failed to shutdown Scheduler - ", e);
  }
  unbind(jndiName);
  log.info("QuartzService(" + jndiName + ") stopped.");
}

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

@Override
public void stopService() throws Exception {
  log.info("Stop QuartzService(" + jndiName + ")...");
  try {
    Scheduler scheduler = schedulerFactory.getScheduler();
    scheduler.shutdown();
  } catch (Exception e) {
    log.error("Failed to shutdown Scheduler", e);
    throw new SchedulerConfigException(
        "Failed to shutdown Scheduler - ", e);
  }
  unbind(jndiName);
  log.info("QuartzService(" + jndiName + ") stopped.");
}

代码示例来源:origin: spring-projects/spring-framework

@Override
public void afterPropertiesSet() throws Exception {
  if (this.dataSource == null && this.nonTransactionalDataSource != null) {
    this.dataSource = this.nonTransactionalDataSource;
  }
  if (this.applicationContext != null && this.resourceLoader == null) {
    this.resourceLoader = this.applicationContext;
  }
  // Initialize the Scheduler instance...
  this.scheduler = prepareScheduler(prepareSchedulerFactory());
  try {
    registerListeners();
    registerJobsAndTriggers();
  }
  catch (Exception ex) {
    try {
      this.scheduler.shutdown(true);
    }
    catch (Exception ex2) {
      logger.debug("Scheduler shutdown exception after registration failure", ex2);
    }
    throw ex;
  }
}

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

@Override
  public void run() {
    getLog().info("Shutting down Quartz...");
    try {
      scheduler.shutdown(isCleanShutdown());
    } catch (SchedulerException e) {
      getLog().info(
          "Error shutting down Quartz: " + e.getMessage(), e);
    }
  }
};

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

@Override
  public void run() {
    getLog().info("Shutting down Quartz...");
    try {
      scheduler.shutdown(isCleanShutdown());
    } catch (SchedulerException e) {
      getLog().info(
          "Error shutting down Quartz: " + e.getMessage(), e);
    }
  }
};

代码示例来源:origin: Dreampie/Resty

public boolean stop() {
 try {
  Quartzer.getSchedulerFactory().getScheduler().shutdown();
  Quartzer.setSchedulerFactory(null);
  return true;
 } catch (Exception e) {
  throw new QuartzException("Can't stop quartz plugin.", e);
 }
}

代码示例来源:origin: spring-projects/spring-framework

verify(scheduler).shutdown(false);

相关文章