public class BasicObjectPool extends java.lang.Object implements QSObjectPool
HashSet| Modifier and Type | Class and Description |
|---|---|
static class |
BasicObjectPool.Config |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicLong |
activeCount |
| Constructor and Description |
|---|
BasicObjectPool() |
BasicObjectPool(org.apache.commons.pool.PoolableObjectFactory factory,
BasicObjectPool.Config config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObject() |
java.lang.Object |
borrowObject() |
void |
clear()
Clears any objects sitting idle in the pool
|
void |
close()
Close this pool, and free any resources associated with it.
|
java.util.Iterator |
getAllActiveObjects()
Returns the iterator of all active objects
|
long |
getHighestActiveCount() |
int |
getNumActive()
Return the number of instances currently borrowed from my pool
|
int |
getNumIdle()
Return the number of instances currently idle in my pool
|
java.lang.Object |
getObjectToSynchronize() |
void |
invalidateObject(java.lang.Object obj)
Invalidates an object from the pool
|
void |
returnObject(java.lang.Object obj)
Return an instance to my pool
|
void |
setFactory(org.apache.commons.pool.PoolableObjectFactory factory)
Sets the factory I use to create new instances
|
void |
setHighestActiveCount(long highestActiveCount) |
public BasicObjectPool()
public BasicObjectPool(org.apache.commons.pool.PoolableObjectFactory factory,
BasicObjectPool.Config config)
public void addObject()
throws java.lang.Exception
addObject in interface org.apache.commons.pool.ObjectPooljava.lang.Exceptionpublic java.lang.Object borrowObject()
throws java.lang.Exception
borrowObject in interface org.apache.commons.pool.ObjectPooljava.lang.Exceptionpublic void clear()
clear in interface org.apache.commons.pool.ObjectPoolpublic void close()
throws java.lang.Exception
close in interface org.apache.commons.pool.ObjectPooljava.lang.Exceptionpublic int getNumActive()
getNumActive in interface org.apache.commons.pool.ObjectPoolpublic int getNumIdle()
getNumIdle in interface org.apache.commons.pool.ObjectPoolpublic void invalidateObject(java.lang.Object obj)
throws java.lang.Exception
invalidateObject in interface org.apache.commons.pool.ObjectPooljava.lang.Exceptionpublic void returnObject(java.lang.Object obj)
throws java.lang.Exception
returnObject in interface org.apache.commons.pool.ObjectPooljava.lang.Exceptionpublic void setFactory(org.apache.commons.pool.PoolableObjectFactory factory)
setFactory in interface org.apache.commons.pool.ObjectPoolpublic java.util.Iterator getAllActiveObjects()
getAllActiveObjects in interface QSObjectPoolpublic java.lang.Object getObjectToSynchronize()
getObjectToSynchronize in interface QSObjectPoolpublic long getHighestActiveCount()
getHighestActiveCount in interface QSObjectPoolpublic void setHighestActiveCount(long highestActiveCount)
highestActiveCount - the highestActiveCount to setCopyright © 2003-2014 QuickServer.org