public abstract class ObjectPool<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
ObjectPool() |
ObjectPool(int poolSize) |
| Modifier and Type | Method and Description |
|---|---|
T |
borrowObject() |
T |
borrowObject(long timeout) |
protected abstract T |
createObject()
Implement to create new objects of type T when the pool is initialized
empty.
|
protected abstract void |
destroyObject(T t)
Clean up pool objects
|
void |
drainPool() |
void |
fillPool() |
protected ReadWriteLock |
getLock()
Gets the ReadWriteLock value of lock for this instance of ObjectPool.
|
int |
getMaxSize()
Gets the int value of maxSize for this instance of ObjectPool.
|
void |
returnObject(T object) |
public void fillPool()
protected abstract T createObject() throws Exception
Exceptionprotected abstract void destroyObject(T t) throws Exception
Exceptionpublic void returnObject(T object) throws Exception
object - Exceptionprotected ReadWriteLock getLock()
public int getMaxSize()
Apache Camel