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.
|
ObjectPool.Statistics |
getStatistics()
Gets a snapshot of the pool's stats at a point in time.
|
boolean |
isShutdown()
Get the state of the pool.
|
void |
shutdown()
Closes any idle objects in the pool.
|
public ObjectPool(ObjectPoolHandler<T> handler, ObjectPoolConfiguration config)
handler
- Handler for objectsconfig
- Configuration for the poolpublic boolean isShutdown()
shutdown()
method was called before.public ObjectPoolEntry<T> borrowObject()
public void shutdown()
public ObjectPool.Statistics getStatistics()
Copyright © 2019. All rights reserved.