R - the type of the resources managed by this pool.X - the type of the exceptions thrown by this pool.public interface Pool<R,X extends Exception>
Implementations must be thread-safe. However, this does not necessarily apply to the implementation of its managed resources.
@CreatesObligation R allocate() throws X extends Exception
Mind that a pool implementation should not hold references to its allocated resources because this could cause a memory leak.
@DischargesObligation void release(R resource) throws X extends Exception
resource - a resource.IllegalArgumentException - if the given resource has not been
allocated by this pool and the implementation cannot tolerate
this.X - if releasing the resource fails for any other reason.X extends ExceptionCopyright © 2012–2015 Schlichtherle IT Services. All rights reserved.