T - the type parameterpublic class Pool<T> extends Object implements Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.commons.pool2.impl.GenericObjectPool<T> |
internalPool
The Internal pool.
|
| Constructor and Description |
|---|
Pool()
Instantiates a new Pool.
|
Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory)
Instantiates a new Pool.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addObjects(int count)
Add objects.
|
protected void |
closeInternalPool()
Close internal pool.
|
void |
destroy()
Destroy.
|
long |
getMaxBorrowWaitTimeMillis()
Gets max borrow wait time millis.
|
long |
getMeanBorrowWaitTimeMillis()
Gets mean borrow wait time millis.
|
int |
getNumActive()
Gets num active.
|
int |
getNumIdle()
Gets num idle.
|
int |
getNumWaiters()
Gets num waiters.
|
T |
getResource()
Gets resource.
|
void |
initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory)
Init pool.
|
void |
returnBrokenResource(T resource)
Return broken resource.
|
void |
returnResource(T resource)
Return resource.
|
protected org.apache.commons.pool2.impl.GenericObjectPool<T> internalPool
public Pool()
public Pool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory)
poolConfig - the pool configfactory - the factorypublic void initPool(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig,
org.apache.commons.pool2.PooledObjectFactory<T> factory)
poolConfig - the pool configfactory - the factoryprotected void closeInternalPool()
throws ScholixException
ScholixException - the scholix exceptionpublic T getResource() throws ScholixException
ScholixException - the scholix exceptionpublic void returnResource(T resource) throws ScholixException
resource - the resourceScholixException - the scholix exceptionpublic void returnBrokenResource(T resource) throws ScholixException
resource - the resourceScholixException - the scholix exceptionpublic void destroy()
throws ScholixException
ScholixException - the scholix exceptionpublic int getNumActive()
public int getNumIdle()
public int getNumWaiters()
public long getMeanBorrowWaitTimeMillis()
public long getMaxBorrowWaitTimeMillis()
Copyright © 2025. All rights reserved.