final ThreadPoolExecutor threadPoolExecutor = rejectionHandler == null ?
new ThreadPoolExecutor(coreSize, maxSize, keepAliveSeconds, TimeUnit.SECONDS, workQueue, threadFactory) :
new ThreadPoolExecutor(coreSize, maxSize, keepAliveSeconds, TimeUnit.SECONDS, workQueue, threadFactory, rejectionHandler);
if (allowCoreThreadTimeout) {
threadPoolExecutor.allowCoreThreadTimeOut(true);
}
if (prestartAllCoreThreads) {
threadPoolExecutor.prestartAllCoreThreads();
}
executorService = threadPoolExecutor;