Example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setMaxPoolSize

List of usage examples for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setMaxPoolSize

Introduction

In this page you can find the example usage for org.springframework.scheduling.concurrent ThreadPoolTaskExecutor setMaxPoolSize.

Prototype

public void setMaxPoolSize(int maxPoolSize) 

Source Link

Document

Set the ThreadPoolExecutor's maximum pool size.

Usage

From source file:com.github.woonsan.jackrabbit.migration.datastore.batch.BatchConfiguration.java

@Bean
public TaskExecutor taskExecutor() {
    final ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
    taskExecutor.setCorePoolSize(getMinWorkers());
    taskExecutor.setMaxPoolSize(getMaxWorkers());
    taskExecutor.setDaemon(true);// w  w  w  .  j  ava 2 s  . c  o  m
    return taskExecutor;
}

From source file:cz.muni.fi.editor.test.service.support.configs.TestConfiguration.java

@Override
public Executor getAsyncExecutor() {
    // move to configuration
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(4);//from   www  .j  a  v  a 2s .c o m
    executor.setMaxPoolSize(42);
    executor.setQueueCapacity(11);
    executor.setThreadNamePrefix("EditorExecutor-");
    executor.initialize();

    return executor;
}

From source file:org.homiefund.config.ApplicationConfiguration.java

@Override
public Executor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(4);/* ww  w .jav a 2  s .  co  m*/
    executor.setMaxPoolSize(42);
    executor.setQueueCapacity(12);
    executor.setThreadNamePrefix("HomieExecutor-");

    executor.initialize();

    return executor;
}

From source file:org.ng200.openolympus.Application.java

@Bean
public ThreadPoolTaskExecutor taskExecutor() {
    final ThreadPoolTaskExecutor pool = new ThreadPoolTaskExecutor();
    pool.setCorePoolSize(5);/*from  w w w. ja v a  2  s.c  o m*/
    pool.setMaxPoolSize(10);
    pool.setWaitForTasksToCompleteOnShutdown(true);
    return pool;
}

From source file:nl.pinniq.web.config.WebMvcConfiguration.java

@Bean
public ThreadPoolTaskExecutor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(5);//from ww  w  . ja v a  2  s .c o  m
    executor.setBeanName("threadPoolTaskExecutor");
    executor.setMaxPoolSize(50);
    executor.setQueueCapacity(10);
    executor.setThreadNamePrefix("MyExecutor-");
    executor.initialize();
    return executor;
}

From source file:py.una.pol.karaku.configuration.AsyncConfiguration.java

/**
 * Crea un nuevo executor. Vase {@link #getAsyncExecutor()}
 *
 * @return {@link Executor} de tareas asncronas
 * @see <a href="http://appcia.cnc.una.py/wf/index.php/Asyn_task">Wiki</a>
 *//*  w w  w.  j  av  a 2s . co  m*/
@Bean
public AsyncTaskExecutor asyncExecutor() {

    final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(getInt("karaku.async.pool.size", DEFAULT_CORE_POOL_SIZE));
    executor.setMaxPoolSize(getInt("karaku.async.pool.max_size", DEFAULT_CORE_POOL_MAX_SIZE));
    executor.setQueueCapacity(getInt("karaku.async.queue.size", DEFAULT_ASYNC_QUEUE_SIZE));
    executor.setThreadNamePrefix(properties.get("karaku.async.thread.prefix", DEFAULT_THREAD_PREFIX));
    // TODO cambiar por un SyncTaskExecutor
    return executor;
}

From source file:com.apress.prospringintegration.concurrency.taskexecutorexample.TaskExecutorExampleConfiguration.java

@Bean
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(50);//www.  jav  a 2  s .c  o m
    executor.setDaemon(false);
    executor.setWaitForTasksToCompleteOnShutdown(true);
    executor.setMaxPoolSize(100);
    executor.setAllowCoreThreadTimeOut(true);
    return executor;
}

From source file:com.google.cloud.trace.zipkin.autoconfigure.ZipkinStackdriverStorageAutoConfiguration.java

@Bean(name = "stackdriverExecutor")
@ConditionalOnMissingBean(Executor.class)
Executor executor() {/*from   w w  w. j a v a 2  s. com*/
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setThreadNamePrefix("ZipkinStackdriverStorage-");
    executor.setCorePoolSize(storageProperties.getExecutor().getCorePoolSize());
    executor.setMaxPoolSize(storageProperties.getExecutor().getMaxPoolSize());
    executor.setQueueCapacity(storageProperties.getExecutor().getQueueCapacity());
    executor.initialize();

    log.info("Configured Executor for ZipkinStackDriver Storage with: {}", storageProperties.getExecutor());
    return executor;
}

From source file:access.Application.java

@Override
@Bean//  ww w .jav a2s  .  c o  m
public Executor getAsyncExecutor() {
    ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
    executor.setCorePoolSize(threadCountSize);
    executor.setMaxPoolSize(threadCountLimit);
    executor.initialize();
    return executor;
}