T - the type of the pool@Beta public class GenericPool<T> extends Object implements org.apache.commons.pool.ObjectPool<T>
| Constructor and Description |
|---|
GenericPool(org.apache.commons.pool.PoolableObjectFactory<T> factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObject() |
T |
borrowObject() |
void |
clear() |
void |
close() |
int |
getNumActive() |
int |
getNumIdle() |
void |
invalidateObject(T obj) |
void |
returnObject(T obj) |
void |
setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory) |
public GenericPool(org.apache.commons.pool.PoolableObjectFactory<T> factory)
factory - the factory of the poolpublic void addObject()
throws Exception,
IllegalStateException,
UnsupportedOperationException
addObject in interface org.apache.commons.pool.ObjectPool<T>ExceptionIllegalStateExceptionUnsupportedOperationExceptionpublic T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
borrowObject in interface org.apache.commons.pool.ObjectPool<T>ExceptionNoSuchElementExceptionIllegalStateExceptionpublic void clear()
throws Exception,
UnsupportedOperationException
clear in interface org.apache.commons.pool.ObjectPool<T>ExceptionUnsupportedOperationExceptionpublic void close()
throws Exception
public int getNumActive()
throws UnsupportedOperationException
getNumActive in interface org.apache.commons.pool.ObjectPool<T>UnsupportedOperationExceptionpublic int getNumIdle()
throws UnsupportedOperationException
getNumIdle in interface org.apache.commons.pool.ObjectPool<T>UnsupportedOperationExceptionpublic void setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory) throws IllegalStateException, UnsupportedOperationException
setFactory in interface org.apache.commons.pool.ObjectPool<T>IllegalStateExceptionUnsupportedOperationExceptionCopyright © 2012 Batoo Software & Consultancy. All Rights Reserved.