public interface Pool<T> extends LifeCycle
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Pool.Dispose<T> |
static interface |
Pool.Validator<T>
Represents the functionality to validate an object of the pool
|
T get()
InterruptedException which might be thrown when the
thread waits for an object to become available.
If the call is a non-blocking one, the call returns immediately
irrespective of whether an object is available or not. If any object is
available the call returns it else the call returns null.
The validity of the objects are determined using the Validator interface,
such that an object o is valid if Validator.isValid(o) == truevoid release(T t)
t - the object to return to the poolint size()
void cleanup()
Copyright © 2016. All rights reserved.