public interface ResourcePool<T extends PooledObject>
PooledObject.| Modifier and Type | Method and Description |
|---|---|
int |
count()
Counts the number of idle elements in the pool.
|
boolean |
isEmpty()
Checks whether the pool contains at least one element.
|
void |
offer(T resource)
Offers an object to be placed into the pool.
|
T |
poll()
Polls an object from the pool.
If the pool is empty, a new object shall be created. |
void |
release()
Releases all resources held by the pool.
|
int |
size()
Gets the maximum size of the pool.
|
T poll()
void offer(T resource)
resource - The object to be placed into the pool.void release()
int count()
int size()
boolean isEmpty()
true is empty, false otherwise.Copyright © 2017 TeleStax, Inc.. All Rights Reserved.