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

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

Introduction

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

Prototype

public void setMaxPoolSize(int maxPoolSize) 

Source Link

Document

Set the ThreadPoolExecutor's maximum pool size.

Usage

From source file:io.pivotal.strepsirrhini.chaoslemur.Application.java

@Bean(destroyMethod = "shutdown")
ThreadPoolExecutorFactoryBean executor() {
    ThreadPoolExecutorFactoryBean factoryBean = new ThreadPoolExecutorFactoryBean();
    factoryBean.setQueueCapacity(5);//from   www .ja  va  2  s  . c om
    factoryBean.setCorePoolSize(5);
    factoryBean.setMaxPoolSize(20);
    factoryBean.setThreadNamePrefix("destroyer-");

    return factoryBean;
}