Example usage for org.springframework.scheduling.quartz SchedulerFactoryBean PROP_THREAD_COUNT

List of usage examples for org.springframework.scheduling.quartz SchedulerFactoryBean PROP_THREAD_COUNT

Introduction

In this page you can find the example usage for org.springframework.scheduling.quartz SchedulerFactoryBean PROP_THREAD_COUNT.

Prototype

String PROP_THREAD_COUNT

To view the source code for org.springframework.scheduling.quartz SchedulerFactoryBean PROP_THREAD_COUNT.

Click Source Link

Document

The thread count property.

Usage

From source file:com.athina.queue.manager.quartz.QuartzProperties.java

public Properties buildQuartzProperties() {
    Properties props = new Properties();
    //skip the check to don't bother with quartz updates
    props.setProperty(StdSchedulerFactory.PROP_SCHED_SKIP_UPDATE_CHECK, Boolean.toString(true));
    props.setProperty(StdSchedulerFactory.PROP_SCHED_INSTANCE_ID,
            StdSchedulerFactory.AUTO_GENERATE_INSTANCE_ID);
    if (threadCount != null) {
        props.setProperty(SchedulerFactoryBean.PROP_THREAD_COUNT, threadCount.toString());
    }/*from w  ww .  ja  v  a  2  s.c  o  m*/
    return props;
}

From source file:org.apache.fineract.infrastructure.jobs.service.JobRegisterServiceImpl.java

private Scheduler createScheduler(final String name, final int noOfThreads, JobListener... jobListeners)
        throws Exception {
    final SchedulerFactoryBean schedulerFactoryBean = new SchedulerFactoryBean();
    schedulerFactoryBean.setSchedulerName(name);
    schedulerFactoryBean.setGlobalJobListeners(jobListeners);
    final TriggerListener[] globalTriggerListeners = { globalSchedulerTriggerListener };
    schedulerFactoryBean.setGlobalTriggerListeners(globalTriggerListeners);
    final Properties quartzProperties = new Properties();
    quartzProperties.put(SchedulerFactoryBean.PROP_THREAD_COUNT, Integer.toString(noOfThreads));
    schedulerFactoryBean.setQuartzProperties(quartzProperties);
    schedulerFactoryBean.afterPropertiesSet();
    schedulerFactoryBean.start();//from   w  ww  . j  a va 2s . co  m
    return schedulerFactoryBean.getScheduler();
}