public class ReleasePermitOnComplete extends 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,
Semaphore available)
Wrap handler to release the permit of the semaphore on
AsyncHandler.onCompleted(). |
public static <T> AsyncHandler<T> wrap(AsyncHandler<T> handler, 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 © 2020. All rights reserved.