// create pool instance.
// set factory
try {
PoolImpl pool = (PoolImpl) getServiceObject();
if (pool != null) pool.stop();
String fname = getFactoryName();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class fc = cl.loadClass(fname);
PoolFactory f = (PoolFactory) fc.newInstance();
pool = new PoolImpl(poolname, f);
pool.setMinSize(minsize);
pool.setMaxSize(maxsize);
pool.setNonBlocking(!isBlocking);
pool.setTimeout(blockingTimeout); // why is it int ???
pool.start();
setServiceObject(pool);
return pool;