Class Overview
Synchronized pool of objects.
Summary
| Public Methods |
|
T
|
acquire()
|
|
boolean
|
release(T element)
Release an instance to the pool.
|
Public Constructors
public
SynchronizedPool
(int maxPoolSize, Object lock)
Parameters
| maxPoolSize |
The max pool size. |
| lock |
an optional custom object to synchronize on |
Throws
| IllegalArgumentException
| If the max pool size is less than zero.
|
public
SynchronizedPool
(int maxPoolSize)
Public Methods
public
boolean
release
(T element)
Release an instance to the pool.
Parameters
| element |
The instance to release. |
Returns
- Whether the instance was put in the pool.