NamedThreadPoolExecutor pool = new NamedThreadPoolExecutor(name, poolSize, poolSize,
60, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(queueCapacity),
new PoolExecutorThreadFactory(node.threadGroup,
node.getThreadPoolNamePrefix(internalName), node.getConfigClassLoader()));
pool.allowCoreThreadTimeOut(true);
executor = pool;
} else {
throw new IllegalArgumentException("Unknown executor type: " + type);
}
return executor;