private PooledExecutor executor;
private ClassLoader classLoader;
private ObjectName objectName;
public ThreadPool(int poolSize, String poolName, long keepAliveTime, ClassLoader classLoader, String objectName) {
PooledExecutor p = new PooledExecutor(poolSize);
p.abortWhenBlocked();
p.setKeepAliveTime(keepAliveTime);
p.setMinimumPoolSize(poolSize);
p.setThreadFactory(new ThreadPoolThreadFactory(poolName, classLoader));
try {
this.objectName = ObjectName.getInstance(objectName);
} catch (MalformedObjectNameException e) {
throw new IllegalStateException("Bad object name injected: "+e.getMessage());
}