| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.apache.commons.pool.BaseObjectPoolorg.apache.commons.pool.impl.SoftReferenceObjectPoolSoftReference based
ObjectPool.
Constructor Summary | |
| |
Method Summary | |
void |
|
Object | |
void |
|
void |
|
int | |
int |
|
void |
|
void |
|
void |
|
Methods inherited from class org.apache.commons.pool.BaseObjectPool | |
addObject, borrowObject, clear, close, getNumActive, getNumIdle, invalidateObject, returnObject, setFactory | |
public SoftReferenceObjectPool()
public SoftReferenceObjectPool(PoolableObjectFactory factory, int initSize) throws Exception
public void addObject()
throws ExceptionCreate an object, and place it into the pool. addObject() is useful for "pre-loading" a pool with idle objects.
- Specified by:
- addObject in interface ObjectPool
- Overrides:
- addObject in interface BaseObjectPool
public Object borrowObject()
throws Exception
- Specified by:
- borrowObject in interface ObjectPool
- Overrides:
- borrowObject in interface BaseObjectPool
public void clear()
- Specified by:
- clear in interface ObjectPool
- Overrides:
- clear in interface BaseObjectPool
public void close()
throws Exception
- Specified by:
- close in interface ObjectPool
- Overrides:
- close in interface BaseObjectPool
public int getNumActive()
- Specified by:
- getNumActive in interface ObjectPool
- Overrides:
- getNumActive in interface BaseObjectPool
public int getNumIdle()
Returns an approximation not less than the of the number of idle instances in the pool.
- Specified by:
- getNumIdle in interface ObjectPool
- Overrides:
- getNumIdle in interface BaseObjectPool
public void invalidateObject(Object obj)
throws Exception
- Specified by:
- invalidateObject in interface ObjectPool
- Overrides:
- invalidateObject in interface BaseObjectPool
public void returnObject(Object obj)
throws Exception
- Specified by:
- returnObject in interface ObjectPool
- Overrides:
- returnObject in interface BaseObjectPool
public void setFactory(PoolableObjectFactory factory) throws IllegalStateException
- Specified by:
- setFactory in interface ObjectPool
- Overrides:
- setFactory in interface BaseObjectPool