|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Pool<R,E extends Exception>
An interface for pooling strategies.
Implementations must be thread-safe. However, this does not necessarily apply to the implementation of its managed resources.
| Nested Class Summary | |
|---|---|
static interface |
Pool.Releasable<E extends Exception>
This interface is designed to be used with Pools which enable their resources to release itself. |
| Method Summary | |
|---|---|
R |
allocate()
Allocates a resource from this pool. |
void |
release(R resource)
Releases a previously allocated resource to this pool. |
| Method Detail |
|---|
@NonNull
R allocate()
throws E extends Exception
Exception - if allocating the resource failed for any reason.
void release(@NonNull
R resource)
throws E extends Exception
IllegalArgumentException or an
IllegalStateException upon the conditions explained below.
resource - a resource.
IllegalArgumentException - if the given resource has not been
allocated by this pool
and the implementation doesn't tolerate this.
IllegalStateException - if the given resource has already been
released to this pool
and the implementation doesn't tolerate this.
Exception - if releasing the resource failed for any other reason.
|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||