static OperationAttachmentsProxy create(final ManagementChannelAssociation channelAssociation, final int batchId, final int size) { return new OperationAttachmentsProxy(channelAssociation, batchId, size); }
static OperationAttachmentsProxy create(final ModelNode operation, final ManagementChannelAssociation channelAssociation, final int batchId, final int size) { return new OperationAttachmentsProxy(operation, getProxiedStreams(channelAssociation, batchId, size)); }
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; }
protected void doExecute(final ModelNode operation, final int attachmentsLength, final ManagementRequestContext<ExecuteRequestContext> context) { final ExecuteRequestContext executeRequestContext = context.getAttachment(); // Set the response information executeRequestContext.initialize(context); final Integer batchId = executeRequestContext.getOperationId(); final OperationMessageHandlerProxy messageHandlerProxy = new OperationMessageHandlerProxy(channelAssociation, batchId); final ProxyOperationControlProxy control = new ProxyOperationControlProxy(executeRequestContext); final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(channelAssociation, batchId, attachmentsLength); final ModelNode result; try { // Execute the operation result = internalExecute(operation, context, messageHandlerProxy, control, attachmentsProxy); } catch (Exception e) { final ModelNode failure = new ModelNode(); failure.get(OUTCOME).set(FAILED); failure.get(FAILURE_DESCRIPTION).set(e.getClass().getName() + ":" + e.getMessage()); control.operationFailed(failure); attachmentsProxy.shutdown(e); return; } if (result.hasDefined(FAILURE_DESCRIPTION)) { control.operationFailed(result); } else { // controller.execute() will block in OperationControl.prepared until the {@code PoxyController} // sent a CompleteTxRequest, which will either commit or rollback the operation control.operationCompleted(result); } } }
final OperationMessageHandlerProxy messageHandlerProxy = new OperationMessageHandlerProxy(channelAssociation, batchId); final ProxyOperationControlProxy control = new ProxyOperationControlProxy(executeRequestContext); final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(channelAssociation, batchId, attachmentsLength); final ModelNode result; try { failure.get(FAILURE_DESCRIPTION).set(e.getClass().getName() + ":" + e.getMessage()); control.operationFailed(failure); attachmentsProxy.shutdown(e); return;
static OperationAttachmentsProxy create(final ManagementChannelAssociation channelAssociation, final int batchId, final int size) { return new OperationAttachmentsProxy(channelAssociation, batchId, size); }
static OperationAttachmentsProxy create(final ModelNode operation, final ManagementChannelAssociation channelAssociation, final int batchId, final int size) { return new OperationAttachmentsProxy(operation, getProxiedStreams(channelAssociation, batchId, size)); }
final OperationMessageHandlerProxy messageHandlerProxy = new OperationMessageHandlerProxy(channelAssociation, batchId); final ProxyOperationTransactionControl control = new ProxyOperationTransactionControl(executeRequestContext); final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); final OperationResponse result; try { failure.get(FAILURE_DESCRIPTION).set(t.getClass().getName() + ":" + t.getMessage()); executeRequestContext.failed(failure); attachmentsProxy.shutdown(); ControllerLogger.MGMT_OP_LOGGER.unexpectedOperationExecutionException(t, Collections.singletonList(operation)); return;
@SuppressWarnings("CloneDoesntCallSuperClone") @Override @Deprecated public final Operation clone() { return new OperationAttachmentsProxy(operation, proxiedStreams); }
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); 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);
@Override @Deprecated public Operation clone(ModelNode operation) { return new OperationAttachmentsProxy(operation, proxiedStreams); }
final OperationMessageHandlerProxy messageHandlerProxy = new OperationMessageHandlerProxy(channelAssociation, batchId); final ProxyOperationTransactionControl control = new ProxyOperationTransactionControl(executeRequestContext); final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); final OperationResponse result; try { failure.get(FAILURE_DESCRIPTION).set(t.getClass().getName() + ":" + t.getMessage()); executeRequestContext.failed(failure); attachmentsProxy.shutdown(); ControllerLogger.MGMT_OP_LOGGER.unexpectedOperationExecutionException(t, Collections.singletonList(operation)); return;
@SuppressWarnings("CloneDoesntCallSuperClone") @Override @Deprecated public final Operation clone() { return new OperationAttachmentsProxy(operation, proxiedStreams); }
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); failure.get(FAILURE_DESCRIPTION).set(t.getClass().getName() + ":" + t.getMessage()); result.set(failure); attachmentsProxy.shutdown(); ControllerLogger.MGMT_OP_LOGGER.unexpectedOperationExecutionException(t, Collections.singletonList(operation)); } finally {
@Override @Deprecated public Operation clone(ModelNode operation) { return new OperationAttachmentsProxy(operation, proxiedStreams); }
final OperationAttachmentsProxy attachmentsProxy = OperationAttachmentsProxy.create(operation, channelAssociation, batchId, attachmentsLength); try { ROOT_LOGGER.tracef("Executing client request %d(%d)", batchId, header.getRequestId()); failure.get(FAILURE_DESCRIPTION).set(t.getClass().getName() + ":" + t.getMessage()); result.set(failure); attachmentsProxy.shutdown(); ControllerLogger.MGMT_OP_LOGGER.unexpectedOperationExecutionException(t, Collections.singletonList(operation)); } finally {