类org.quartz.simpl.RAMJobStore源码实例Demo

下面列出了怎么用org.quartz.simpl.RAMJobStore的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dropwizard-experiment   文件: Quartz.java
private Properties getProperties() {
    Properties props = new Properties();

    props.setProperty("org.quartz.jobStore.class", quartzConfig.getJobStore().getName());
    props.setProperty("org.quartz.threadPool.threadCount", String.valueOf(quartzConfig.getThreads()));

    if (!quartzConfig.getJobStore().equals(RAMJobStore.class)) {
        props.setProperty("org.quartz.jobStore.driverDelegateClass", quartzConfig.getDbDelegate().getName());
        props.setProperty("org.quartz.jobStore.dataSource", "main");
        props.setProperty("org.quartz.dataSource.main.driver", dbConfig.getDriverClass());
        props.setProperty("org.quartz.dataSource.main.URL", dbConfig.getUrl());
        props.setProperty("org.quartz.dataSource.main.user", dbConfig.getUser());
        props.setProperty("org.quartz.dataSource.main.password", dbConfig.getPassword());
    }

    return props;
}
 
源代码2 项目: AsuraFramework   文件: DirectSchedulerFactory.java
/**
 * Creates an in memory job store (<code>{@link RAMJobStore}</code>)
 * The thread priority is set to Thread.NORM_PRIORITY
 *
 * @param maxThreads
 *          The number of threads in the thread pool
 * @throws SchedulerException
 *           if initialization failed.
 */
public void createVolatileScheduler(int maxThreads)
    throws SchedulerException {
    SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads,
            Thread.NORM_PRIORITY);
    threadPool.initialize();
    JobStore jobStore = new RAMJobStore();
    this.createScheduler(threadPool, jobStore);

}
 
源代码3 项目: quartz-glass   文件: SpringConfig.java
@Bean
public Scheduler quartzScheduler(ApplicationContext context) throws Exception {
    SchedulerFactoryBean factory = new SchedulerFactoryBean();

    factory.setApplicationContext(context);
    factory.setExposeSchedulerInRepository(true);
    factory.setApplicationContextSchedulerContextKey(APPLICATION_CONTEXT_KEY);
    factory.setJobFactory(glassJobFactory);

    Properties properties = new Properties();
    properties.setProperty("org.quartz.scheduler.skipUpdateCheck","true");
    properties.setProperty("org.quartz.threadPool.class", SimpleThreadPool.class.getName());
    properties.setProperty("org.quartz.threadPool.threadCount", "15");
    properties.setProperty("org.quartz.threadPool.threadPriority", "4");

    if (configuration().isInMemory()) {
        properties.setProperty("org.quartz.jobStore.class", RAMJobStore.class.getName());
    } else {
        factory.setDataSource(dataSource());

        properties.setProperty("org.quartz.jobStore.tablePrefix", configuration().getTablePrefix());
        properties.setProperty("org.quartz.jobStore.isClustered", "false");
        properties.setProperty("org.quartz.jobStore.driverDelegateClass", configuration().getDriverDelegateClass());
    }

    factory.setQuartzProperties(properties);

    factory.afterPropertiesSet();

    Scheduler scheduler = factory.getObject();

    scheduler.getListenerManager().addJobListener(glassJobListener);
    scheduler.getListenerManager().addSchedulerListener(glassSchedulerListener);

    scheduler.start();

    return scheduler;
}
 
源代码4 项目: lams   文件: DirectSchedulerFactory.java
/**
 * Creates an in memory job store (<code>{@link RAMJobStore}</code>)
 * The thread priority is set to Thread.NORM_PRIORITY
 *
 * @param maxThreads
 *          The number of threads in the thread pool
 * @throws SchedulerException
 *           if initialization failed.
 */
public void createVolatileScheduler(int maxThreads)
    throws SchedulerException {
    SimpleThreadPool threadPool = new SimpleThreadPool(maxThreads,
            Thread.NORM_PRIORITY);
    threadPool.initialize();
    JobStore jobStore = new RAMJobStore();
    this.createScheduler(threadPool, jobStore);
}
 
 类所在包
 类方法
 同包方法