public class ReleasePermitOnComplete
extends java.lang.Object
AsyncHandlers to release a permit on AsyncHandler.onCompleted(). This is done via a dynamic proxy to preserve all interfaces of the wrapped handler.| Constructor and Description |
|---|
ReleasePermitOnComplete() |
| Modifier and Type | Method and Description |
|---|---|
static <T> AsyncHandler<T> |
wrap(AsyncHandler<T> handler,
java.util.concurrent.Semaphore available)
Wrap handler to release the permit of the semaphore on
AsyncHandler.onCompleted(). |
public static <T> AsyncHandler<T> wrap(AsyncHandler<T> handler, java.util.concurrent.Semaphore available)
AsyncHandler.onCompleted().T - the handler result typehandler - the handler to be wrappedavailable - the Semaphore to be released when the wrapped handler is completedCopyright © 2018. All Rights Reserved.