public class SharedSingletonObjectPool<T> extends Object implements org.apache.commons.pool2.ObjectPool<T>
ObjectPool that uses a single shared instance.
This implementation will always return 1 in getNumActive() and return 0 in
getNumIdle().| Constructor and Description |
|---|
SharedSingletonObjectPool(org.apache.commons.pool2.PooledObjectFactory<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) |
public SharedSingletonObjectPool(org.apache.commons.pool2.PooledObjectFactory<T> factory)
public void addObject()
throws Exception,
IllegalStateException,
UnsupportedOperationException
addObject in interface org.apache.commons.pool2.ObjectPool<T>ExceptionIllegalStateExceptionUnsupportedOperationExceptionpublic T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
borrowObject in interface org.apache.commons.pool2.ObjectPool<T>ExceptionNoSuchElementExceptionIllegalStateExceptionpublic void clear()
throws Exception,
UnsupportedOperationException
clear in interface org.apache.commons.pool2.ObjectPool<T>ExceptionUnsupportedOperationExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableclose in interface org.apache.commons.pool2.ObjectPool<T>public int getNumActive()
getNumActive in interface org.apache.commons.pool2.ObjectPool<T>public int getNumIdle()
getNumIdle in interface org.apache.commons.pool2.ObjectPool<T>Apache Camel