use of org.forgerock.openam.radius.server.config.ThreadPoolConfig in project OpenAM by OpenRock.
the class RequestListenerFactory method getRadiusRequestListener.
/**
* Factory method to obtain a new RadiusRequestListener.
*
* @param serviceConfig - the configuration of the RADIUS service.
* @return a <code>RadiusRquestListener</code>
* @throws RadiusLifecycleException - if a RquestListener can not be created.
*/
public RadiusRequestListener getRadiusRequestListener(RadiusServiceConfig serviceConfig) throws RadiusLifecycleException {
final ThreadPoolConfig poolConfig = serviceConfig.getThreadPoolConfig();
final int coreSize = poolConfig.getCoreThreads();
final int maxSize = poolConfig.getMaxThreads();
final int idleTimeout = poolConfig.getKeepAliveSeconds();
final ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(poolConfig.getQueueSize());
final ExecutorService executorService = executorServiceFactory.createThreadPool(coreSize, maxSize, idleTimeout, TimeUnit.SECONDS, queue);
return new RadiusRequestListener(serviceConfig, executorService, eventBus, accessRequestHandlerFactory);
}
Aggregations