use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project dubion by valsamiq.
the class AsyncConfiguration method getAsyncExecutor.
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("dubion-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project Spring-Family by Sierou-Java.
the class TaskExecutorConfig method getAsyncExecutor.
/**
* 配置类实现AsyncConfigurer接口并重写getAsyncExecutor方法,
* 并返回ThreadPoolTaskExecutor ,这样就获得了一个基于线程池的TaskExecutor。
* @return
*/
@Override
public Executor getAsyncExecutor() {
// ②
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(5);
taskExecutor.setMaxPoolSize(10);
taskExecutor.setQueueCapacity(25);
taskExecutor.initialize();
return taskExecutor;
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project jhipster-sample-app-oauth2 by jhipster.
the class AsyncConfiguration method getAsyncExecutor.
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("jhipster-oauth-2-sample-application-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project jhipster-sample-app-cassandra by jhipster.
the class AsyncConfiguration method getAsyncExecutor.
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("jhipster-cassandra-sample-application-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
use of org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor in project jhipster-sample-app-mongodb by jhipster.
the class AsyncConfiguration method getAsyncExecutor.
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("jhipster-mongodb-sample-application-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
Aggregations