if ( (instance == null) ) {
synchronized (BufferPool.class) {
if ( instance == null ) {
BufferPoolAPI pool = null;
Class clazz = null;
try {
clazz = Class.forName("org.apache.catalina.tribes.io.BufferPool15Impl");
pool = (BufferPoolAPI)clazz.newInstance();
} catch ( Throwable x ) {
try {
clazz = Class.forName("org.apache.catalina.tribes.io.BufferPool14Impl");
pool = (BufferPoolAPI)clazz.newInstance();
} catch ( Throwable e ) {
log.warn("Unable to initilize BufferPool, not pooling XByteBuffer objects:"+x.getMessage());
if ( log.isDebugEnabled() ) log.debug("Unable to initilize BufferPool, not pooling XByteBuffer objects:",x);
}
}
pool.setMaxSize(DEFAULT_POOL_SIZE);
log.info("Created a buffer pool with max size:"+DEFAULT_POOL_SIZE+" bytes of type:"+(clazz!=null?clazz.getName():"null"));
instance = new BufferPool(pool);
}//end if
}//sync
}//end if
return instance;