/** {@inheritDoc} */ @Override public <T, A> AsyncFuture<T> executeRequest(final Integer operationId, final ManagementRequest<T, A> request) throws IOException { final ActiveOperation<T, A> operation = super.getActiveOperation(operationId); if(operation == null) { throw ProtocolMessages.MESSAGES.responseHandlerNotFound(operationId); } return executeRequest(operation, request); }
/** * Handle a message. * * @param channel the channel * @param message the message * @param header the protocol header * @param handler the request handler * @throws IOException */ protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException { final ActiveOperation<T, A> support = getActiveOperation(header); if(support == null) { throw ProtocolMessages.MESSAGES.responseHandlerNotFound(header.getBatchId()); } handleMessage(channel, message, header, support, handler); }
if(request == null) { ProtocolLogger.CONNECTION_LOGGER.noSuchRequest(response.getResponseId(), channel); safeWriteErrorResponse(channel, header, ProtocolMessages.MESSAGES.responseHandlerNotFound(response.getResponseId())); } else if(response.getError() != null) { request.handleFailed(response); final ManagementRequestHandler<?, ?> handler = getRequestHandler(requestHeader); if(handler == null) { safeWriteErrorResponse(channel, header, ProtocolMessages.MESSAGES.responseHandlerNotFound(requestHeader.getBatchId())); } else { handleMessage(channel, input, requestHeader, handler);