Class PoolUtils.SynchronizedObjectPool<T>

java.lang.Object
org.apache.commons.pool2.PoolUtils.SynchronizedObjectPool<T>
Type Parameters:
T - type of objects in the pool
All Implemented Interfaces:
Closeable, AutoCloseable, ObjectPool<T>
Enclosing class:
PoolUtils

private static final class PoolUtils.SynchronizedObjectPool<T> extends Object implements ObjectPool<T>
A synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.

Note: This should not be used on pool implementations that already provide proper synchronization such as the pools provided in the Commons Pool library. Wrapping a pool that waits for poolable objects to be returned before allowing another one to be borrowed with another layer of synchronization will cause liveliness issues or a deadlock.