public class SharedSingletonObjectPool<T> extends Object implements org.apache.commons.pool.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.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 SharedSingletonObjectPool(org.apache.commons.pool.PoolableObjectFactory<T> factory)
public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException
borrowObject
in interface org.apache.commons.pool.ObjectPool<T>
Exception
NoSuchElementException
IllegalStateException
public void addObject() throws Exception, IllegalStateException, UnsupportedOperationException
addObject
in interface org.apache.commons.pool.ObjectPool<T>
Exception
IllegalStateException
UnsupportedOperationException
public int getNumIdle() throws UnsupportedOperationException
getNumIdle
in interface org.apache.commons.pool.ObjectPool<T>
UnsupportedOperationException
public int getNumActive() throws UnsupportedOperationException
getNumActive
in interface org.apache.commons.pool.ObjectPool<T>
UnsupportedOperationException
public void clear() throws Exception, UnsupportedOperationException
clear
in interface org.apache.commons.pool.ObjectPool<T>
Exception
UnsupportedOperationException
public void close() throws Exception
public void setFactory(org.apache.commons.pool.PoolableObjectFactory<T> factory) throws IllegalStateException, UnsupportedOperationException
setFactory
in interface org.apache.commons.pool.ObjectPool<T>
IllegalStateException
UnsupportedOperationException
Apache Camel