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

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

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

Scheduler.clear介绍

[英]Clears (deletes!) all scheduling data - all Jobs, Triggers Calendars.
[中]清除(删除!)所有计划数据-所有作业、触发器和日历。

代码示例

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

public void cleanup() {
 logger.info("Cleaning up schedules in scheduler");
 try {
  this.scheduler.clear();
 } catch (final SchedulerException e) {
  logger.error("Exception clearing scheduler: ", e);
 }
}

代码示例来源:origin: cn.easyproject/easybackup

/**
 * Clear all Job
 */
public void clear() {
  try {
    scheduler.clear();
  } catch (SchedulerException e) {
    logger.error("Can not reload properties, clear job failure!", e);
  }
}

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

public void clear() {
  try {
    scheduler.clear();
  } catch (final SchedulerException e) {
    throw new QuartzSchedulerException(e);
  }
}

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

public void clear() {
  try {
    scheduler.clear();
  } catch (SchedulerException e) {
    throw new QuartzRuntimeException(e);
  }
}

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

@Override
public void clear() throws SchedulerException {
  getScheduler().clear();
}

代码示例来源:origin: salesforce/Argus

private void _disposeScheduler(Scheduler scheduler) {
  if (scheduler != null) {
    try {
      _logger.info("Stopping scheduler {}", _getSchedulerName(scheduler));
      scheduler.clear();
      scheduler.shutdown();
      _logger.info("Finished stopping scheduler {}", _getSchedulerName(scheduler));
    } catch (SchedulerException e) {
      _logger.error("Quartz failed to shutdown {}", e);
    }
  }
}

代码示例来源:origin: com.salesforce.argus/argus-core

private void _disposeScheduler(Scheduler scheduler) {
  if (scheduler != null) {
    try {
      _logger.info("Stopping scheduler {}", _getSchedulerName(scheduler));
      scheduler.clear();
      scheduler.shutdown();
      _logger.info("Finished stopping scheduler {}", _getSchedulerName(scheduler));
    } catch (SchedulerException e) {
      _logger.error("Quartz failed to shutdown {}", e);
    }
  }
}

代码示例来源:origin: stackoverflow.com

public static void main(String[] args) throws Exception {
 JobKey jobKeySMS = new JobKey("SMSJob", "Groupe1");
 JobDetail jobDetailSMS = JobBuilder.newJob(SendSMS.class).withIdentity(jobKeySMS).build();
 Scheduler scheduler = new StdSchedulerFactory().getScheduler();
 scheduler.clear();
 scheduler.start();
 scheduler.scheduleJob(jobDetailSMS, DYNAMIC_TRIGGER); // DYNAMIC_TRIGGER recover from web UI

代码示例来源:origin: webrtc/KITE

@Override
public void jobWasExecuted(JobExecutionContext jobExecutionContext, JobExecutionException e) {
 // Clear and Shutdown the scheduler.
 if (jobExecutionContext.getJobDetail().getJobDataMap().getBoolean("shouldShutdown")) {
  Scheduler scheduler = jobExecutionContext.getScheduler();
  try {
   scheduler.clear();
  } catch (SchedulerException se) {
   logger.error("Exception while clearing the Scheduler", se);
  }
  try {
   scheduler.shutdown();
  } catch (SchedulerException se) {
   logger.error("Exception while shutting down the Scheduler", se);
  }
 }
}

代码示例来源:origin: MrNeuronix/IRISv2

public void stop() {
    jsonMessaging.close();
    try {
      scheduler.clear();
      scheduler.shutdown();
    } catch (SchedulerException e) {
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: org.openksavi.sponge/sponge-core

/**
 * Shuts down this event scheduler.
 */
@Override
public void doShutdown() {
  if (scheduler != null) {
    try {
      scheduler.clear();
      scheduler.shutdown(true);
    } catch (SchedulerException e) {
      throw SpongeUtils.wrapException(getName(), e);
    }
  }
}

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

@Override
  public void clear() throws QuartzException {
    try {
      delegate.clear();
    } catch (SchedulerException e) {
      Logger.error(e.getMessage());
      throw new QuartzException(e);
    }
  }
}

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

@Override
  public void clear() throws QuartzException {
    try {
      delegate.clear();
    } catch (SchedulerException e) {
      Logger.error(e.getMessage());
      throw new QuartzException(e);
    }
  }
}

代码示例来源:origin: org.spincast/spincast-plugins-scheduledtasks

@Override
  public Scheduler get() {

    try {
      Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();

      //==========================================
      // "Clear" is required (at least during during tests
      // because StdSchedulerFactory.getDefaultScheduler()
      // reuses a static instance!
      //==========================================
      scheduler.clear();
      scheduler.setJobFactory(getSpincastScheduledTaskFactory());
      scheduler.start();
      return scheduler;
    } catch (Exception ex) {
      throw SpincastStatics.runtimize(ex);
    }
  }
}

代码示例来源:origin: webrtc/KITE

if (scheduler != null && (scheduler.isStarted() || !scheduler.isShutdown())) {
 try {
  scheduler.clear();
 } catch (SchedulerException se) {
  logger.warn("Exception while clearing the Scheduler", e);

相关文章