本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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");
}
示例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");
}
示例9: init
import org.quartz.SchedulerContext; //导入方法依赖的package包/类
public static void init(SchedulerContext schedulerContext) {
schedulerContext.put(INDEX_ARRAY, new Vector());
LOG.info("Indexer queue initialized");
}