public static ManagementResponseHeader create(final ManagementRequestHeader header) { return create(header, header.getRequestId()); }
public static ManagementResponseHeader create(final ManagementRequestHeader header) { return create(header, header.getRequestId()); }
public static ManagementResponseHeader create(final ManagementRequestHeader header) { return create(header, header.getRequestId()); }
public static ManagementResponseHeader create(final ManagementRequestHeader header, Throwable error) { final int workingVersion = Math.min(ManagementProtocol.VERSION, header.getVersion()); return new ManagementResponseHeader(workingVersion, header.getRequestId(), error != null ? error.getClass().getName() + ':' + error.getMessage() : null); }
public static ManagementResponseHeader create(final ManagementRequestHeader header, Throwable error) { final int workingVersion = Math.min(ManagementProtocol.VERSION, header.getVersion()); return new ManagementResponseHeader(workingVersion, header.getRequestId(), error != null ? error.getClass().getName() + ':' + error.getMessage() : null); }
public static ManagementResponseHeader create(final ManagementRequestHeader header, Exception error) { final int workingVersion = Math.min(ManagementProtocol.VERSION, header.getVersion()); return new ManagementResponseHeader(workingVersion, header.getRequestId(), error != null ? error.getMessage() : null); }
protected ModelNode doExecute(final ModelNode operation, final int attachmentsLength, final ManagementRequestContext<Void> context) { //Add a header to show that this operation comes from a user. If this is a host controller and the operation needs propagating to the //servers it will be removed by the domain ops responsible for propagation to the servers. operation.get(OPERATION_HEADERS, CALLER_TYPE).set(USER); final ManagementRequestHeader header = ManagementRequestHeader.class.cast(context.getRequestHeader()); final int batchId = header.getBatchId(); final ModelNode result = new ModelNode(); final OperationMessageHandlerProxy messageHandlerProxy = new OperationMessageHandlerProxy(channelAssociation, batchId); final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); result.set(controller.execute( operation, messageHandlerProxy, ModelController.OperationTransactionControl.COMMIT, attachmentsProxy)); } catch (Exception e) { final ModelNode failure = new ModelNode(); failure.get(OUTCOME).set(FAILED); failure.get(FAILURE_DESCRIPTION).set(e.getClass().getName() + ":" + e.getMessage()); result.set(failure); attachmentsProxy.shutdown(e); } finally { ROOT_LOGGER.tracef("Executed client request %d", batchId); } return result; }
@Override public void handleRequest(final DataInput input, ActiveOperation.ResultHandler<T> resultHandler, ManagementRequestContext<A> context) throws IOException { final Exception error = ProtocolMessages.MESSAGES.noSuchResponseHandler(Integer.toHexString(header.getRequestId())); if(resultHandler.failed(error)) { safeWriteErrorResponse(context.getChannel(), context.getRequestHeader(), error); } } };
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); result.set(controller.execute( operation,
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); OperationResponse response = controller.execute(attachmentsProxy, messageHandlerProxy, transactionControl);
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); OperationResponse response = controller.execute(attachmentsProxy, messageHandlerProxy, transactionControl);