}
private <T extends ExecutorService> T createExecutorService(ThreadPoolConfiguration threadPoolConfiguration,
GlobalConfiguration globalCfg, String componentName, ExecutorServiceType type) {
ThreadFactory threadFactory;
ThreadPoolExecutorFactory executorFactory;
if (threadPoolConfiguration != null) {
threadFactory = threadPoolConfiguration.threadFactory() != null
? threadPoolConfiguration.threadFactory()
: createThreadFactoryWithDefaults(globalCfg, componentName);
executorFactory = threadPoolConfiguration.threadPoolFactory() != null