public class ObjectPool<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ObjectPool.Statistics
Statistics bean
|
Constructor and Description |
---|
ObjectPool(ObjectPoolHandler<T> handler,
ObjectPoolConfiguration config)
Create a new ObjectPool
|
Modifier and Type | Method and Description |
---|---|
ObjectPoolEntry<T> |
borrowObject()
Borrow an object from the pool.
|
void |
disposeAllObjects()
Disposes all objects in the pool.
|
String |
getPoolName() |
ObjectPool.Statistics |
getStatistics()
Gets a snapshot of the pool's stats at a point in time.
|
boolean |
isDisposing() |
boolean |
isShutdown()
Get the state of the pool.
|
void |
setPoolName(String poolName) |
void |
shutdown()
Closes any idle objects in the pool.
|
String |
toString() |
public ObjectPool(ObjectPoolHandler<T> handler, ObjectPoolConfiguration config)
handler
- Handler for objectsconfig
- Configuration for the poolpublic boolean isShutdown()
shutdown()
method was called before.public boolean isDisposing()
public String getPoolName()
public void setPoolName(String poolName)
public ObjectPoolEntry<T> borrowObject()
public void disposeAllObjects()
public void shutdown()
public ObjectPool.Statistics getStatistics()
Copyright © 2022. All rights reserved.