use of io.dropwizard.lifecycle.ExecutorServiceManager in project dropwizard by dropwizard.
the class ScheduledExecutorServiceBuilder method build.
public ScheduledExecutorService build() {
final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(poolSize, threadFactory, handler);
environment.manage(new ExecutorServiceManager(executor, shutdownTime, nameFormat));
return executor;
}
use of io.dropwizard.lifecycle.ExecutorServiceManager in project dropwizard by dropwizard.
the class ExecutorServiceBuilder method build.
public ExecutorService build() {
if (corePoolSize != maximumPoolSize && maximumPoolSize > 1 && !isBoundedQueue()) {
log.warn("Parameter 'maximumPoolSize' is conflicting with unbounded work queues");
}
final ThreadPoolExecutor executor = new ThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime.getQuantity(), keepAliveTime.getUnit(), workQueue, threadFactory, handler);
environment.manage(new ExecutorServiceManager(executor, shutdownTime, nameFormat));
return executor;
}
Aggregations