private boolean statsActive = true;
private PoolStatsImpl stats = new PoolStatsImpl();
private Map clients = new HashMap();
public ThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader classLoader, String objectName) {
ThreadPoolExecutor p = new ThreadPoolExecutor(
poolSize, // core size
poolSize, // max size
keepAliveTime, TimeUnit.MILLISECONDS,
new SynchronousQueue());
p.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());
p.setThreadFactory(new ThreadPoolThreadFactory(poolName, classLoader));
try {
this.objectName = ObjectName.getInstance(objectName);
} catch (MalformedObjectNameException e) {
throw new IllegalStateException("Bad object name injected: " + e.getMessage());