use of org.infinispan.configuration.global.ThreadPoolBuilderAdapter in project infinispan by infinispan.
the class Parser method createThreadPoolConfiguration.
private ThreadPoolConfiguration createThreadPoolConfiguration(String threadPoolName, String componentName, ConfigurationBuilderHolder holder) {
ThreadsConfigurationBuilder threads = holder.getGlobalConfigurationBuilder().threads();
ThreadPoolBuilderAdapter threadPool = threads.getThreadPool(threadPoolName);
if (threadPool == null)
throw CONFIG.undefinedThreadPoolName(threadPoolName);
ThreadPoolConfiguration threadPoolConfiguration = threadPool.asThreadPoolConfigurationBuilder();
boolean isNonBlocking = threadPoolConfiguration.threadPoolFactory().createsNonBlockingThreads();
if (NON_BLOCKING_EXECUTOR.equals(componentName) && !isNonBlocking) {
throw CONFIG.threadPoolFactoryIsBlocking(threadPoolName, componentName);
}
DefaultThreadFactory threadFactory = threadPoolConfiguration.threadFactory();
if (threadFactory != null) {
threadFactory.setComponent(shortened(componentName));
}
return threadPoolConfiguration;
}
Aggregations