void doBind(final AsyncResponse response, final AsyncFuture<?> callback) { response.setTimeoutHandler(asyncResponse -> { log.debug("client timed out"); callback.cancel(); }); response.register((CompletionCallback) throwable -> { log.debug("client completed"); callback.cancel(); }); response.register((ConnectionCallback) disconnected -> { log.debug("client disconnected"); callback.cancel(); }); }
@Override void setContext(RequestScope requestScope, Instance requestScopeInstance, ContainerRequest requestContext, ContainerResponse responseContext, ConnectionCallback connectionCallbackRunner, Value<AsyncContext> asyncContext) throws IOException { super.setContext(requestScope, requestScopeInstance, requestContext, responseContext, connectionCallbackRunner, asyncContext); latch.countDown(); }