当前位置: 首页>>代码示例>>Java>>正文


Java SchedulerContext.put方法代码示例

本文整理汇总了Java中org.quartz.SchedulerContext.put方法的典型用法代码示例。如果您正苦于以下问题:Java SchedulerContext.put方法的具体用法?Java SchedulerContext.put怎么用?Java SchedulerContext.put使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.quartz.SchedulerContext的用法示例。


在下文中一共展示了SchedulerContext.put方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initAutomaticScheduler

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
/**
 * 初始化自动的调度器数据
 *
 * @param scheduler 调度器
 * @param jobBeanFactory JobBean工厂
 */
static void initAutomaticScheduler(Scheduler scheduler, JobBeanFactory jobBeanFactory) {
    try {
        SchedulerContext schedulerContext = scheduler.getContext();
        schedulerContext.put(JOB_BEAN_FACTORY_KEY, jobBeanFactory);
        schedulerContext.put(SCHEDULE_MODE_KEY, ScheduleMode.AUTOMATIC);
    } catch (SchedulerException e) {
        LoggerHelper.error("get schedule context failed.", e);
        throw new NiubiException(e);
    }
}
 
开发者ID:xiaolongzuo,项目名称:niubi-job,代码行数:17,代码来源:JobDataMapManager.java

示例2: initManualScheduler

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
/**
 * 初始化手动的调度器数据
 *
 * @param scheduler 调度器
 */
static void initManualScheduler(Scheduler scheduler) {
    try {
        SchedulerContext schedulerContext = scheduler.getContext();
        schedulerContext.put(SCHEDULE_MODE_KEY, ScheduleMode.MANUAL);
    } catch (SchedulerException e) {
        LoggerHelper.error("get schedule context failed.", e);
        throw new NiubiException(e);
    }
}
 
开发者ID:xiaolongzuo,项目名称:niubi-job,代码行数:15,代码来源:JobDataMapManager.java

示例3: createAndInitScheduler

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
private void createAndInitScheduler() throws SchedulerException {
    LOG.info("Create and initializing scheduler.");
    scheduler = createScheduler();

    SchedulerContext quartzContext = storeCamelContextInQuartzContext();

    // Set camel job counts to zero. We needed this to prevent shutdown in case there are multiple Camel contexts
    // that has not completed yet, and the last one with job counts to zero will eventually shutdown.
    AtomicInteger number = (AtomicInteger) quartzContext.get(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT);
    if (number == null) {
        number = new AtomicInteger(0);
        quartzContext.put(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT, number);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:15,代码来源:QuartzComponent.java

示例4: storeCamelContextInQuartzContext

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
private SchedulerContext storeCamelContextInQuartzContext() throws SchedulerException {
    // Store CamelContext into QuartzContext space
    SchedulerContext quartzContext = scheduler.getContext();
    String camelContextName = QuartzHelper.getQuartzContextName(getCamelContext());
    LOG.debug("Storing camelContextName={} into Quartz Context space.", camelContextName);
    quartzContext.put(QuartzConstants.QUARTZ_CAMEL_CONTEXT + "-" + camelContextName, getCamelContext());
    return quartzContext;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:9,代码来源:QuartzComponent.java

示例5: execute

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
  try {
    SchedulerContext schedulerContext = context.getScheduler().getContext();
    schedulerContext.put(JOB_THREAD, Thread.currentThread());
    CyclicBarrier barrier = (CyclicBarrier) schedulerContext.get(BARRIER);
    barrier.await(TEST_TIMEOUT_SECONDS, TimeUnit.SECONDS);
  }
  catch (Throwable e) {
    e.printStackTrace();
    throw new AssertionError("Await on barrier was interrupted: " + e.toString());
  }
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:14,代码来源:SchedulerTest.java

示例6: execute

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
@Override
public void execute(JobExecutionContext context)
  throws JobExecutionException {

  try {
    SchedulerContext schedulerContext = context.getScheduler().getContext();
    schedulerContext.put(JOB_THREAD, Thread.currentThread());
    CyclicBarrier barrier = (CyclicBarrier) schedulerContext.get(BARRIER);
    barrier.await(TEST_TIMEOUT_SECONDS, TimeUnit.SECONDS);
  } catch (Throwable e) {
    e.printStackTrace();
    throw new AssertionError("Await on barrier was interrupted: " + e.toString());
  }
}
 
开发者ID:FlavioF,项目名称:quartz-scheduler-hazelcast-jobstore,代码行数:15,代码来源:QuartzTest.java

示例7: init

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
public static void init(SchedulerContext schedulerContext) {
  schedulerContext.put(WIKI_EXPORT_ARRAY, new Vector());
  schedulerContext.put(WIKI_AVAILABLE_ARRAY, new Vector());
  LOG.info("Wiki export queues initialized");
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:6,代码来源:WikiExporterJob.java

示例8: init

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
public static void init(SchedulerContext schedulerContext) {
  schedulerContext.put(IMAGE_RESIZER_ARRAY, new Vector());
  LOG.info("Image resizer queue initialized");
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:5,代码来源:ImageResizerJob.java

示例9: init

import org.quartz.SchedulerContext; //导入方法依赖的package包/类
public static void init(SchedulerContext schedulerContext) {
  schedulerContext.put(INDEX_ARRAY, new Vector());
  LOG.info("Indexer queue initialized");
}
 
开发者ID:Concursive,项目名称:concourseconnect-community,代码行数:5,代码来源:IndexerJob.java


注:本文中的org.quartz.SchedulerContext.put方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。