assert support != null; final Integer requestId = this.requestID.incrementAndGet(); final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request, channel); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType());
safeWriteErrorResponse(channel, header, ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(response.getResponseId())); } else if(response.getError() != null) { request.handleFailed(response); } else { handleRequest(channel, input, header, request);
safeWriteErrorResponse(channel, header, ProtocolMessages.MESSAGES.responseHandlerNotFound(response.getResponseId())); } else if(response.getError() != null) { request.handleFailed(response); } else { handleRequest(channel, input, header, request);
safeWriteErrorResponse(channel, header, ProtocolLogger.ROOT_LOGGER.responseHandlerNotFound(response.getResponseId())); } else if(response.getError() != null) { request.handleFailed(response); } else { handleRequest(channel, input, header, request);
/** * Execute a request. * * @param request the request * @param channel the channel * @param support the request support * @return the future result */ protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) { assert support != null; updateChannelRef(support, channel); final Integer requestId = this.requestID.incrementAndGet(); final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType()); final ActiveOperation.ResultHandler<T> resultHandler = support.getResultHandler(); try { request.sendRequest(resultHandler, new ManagementRequestContextImpl<T, A>(support, channel, header, getExecutor())); } catch (Exception e) { resultHandler.failed(e); requests.remove(requestId); } return support.getResult(); }
/** * Execute a request. * * @param request the request * @param channel the channel * @param support the request support * @return the future result */ protected <T, A> AsyncFuture<T> executeRequest(final ManagementRequest<T, A> request, final Channel channel, final ActiveOperation<T, A> support) { assert support != null; updateChannelRef(support, channel); final Integer requestId = this.requestID.incrementAndGet(); final ActiveRequest<T, A> ar = new ActiveRequest<T, A>(support, request); requests.put(requestId, ar); final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, requestId, support.getOperationId(), request.getOperationType()); final ActiveOperation.ResultHandler<T> resultHandler = support.getResultHandler(); try { request.sendRequest(resultHandler, new ManagementRequestContextImpl<T, A>(support, channel, header, getExecutor())); } catch (Exception e) { resultHandler.failed(e); requests.remove(requestId); } return support.getResult(); }