@Override public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<ModelNode> resultHandler, final ManagementRequestContext<Void> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling ExecuteRequest for %d", context.getOperationId()); InetSocketAddress peerSocketAddress = channelAssociation.getChannel().getConnection().getPeerAddress(InetSocketAddress.class); final InetAddress remoteAddress = peerSocketAddress != null ? peerSocketAddress.getAddress() : null; final ModelNode operation = new ModelNode(); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_OPERATION); operation.readExternal(input); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_INPUTSTREAMS_LENGTH); final int attachmentsLength = input.readInt(); context.executeAsync(new ManagementRequestContext.AsyncTask<Void>() { @Override public void execute(final ManagementRequestContext<Void> context) throws Exception { final ManagementResponseHeader response = ManagementResponseHeader.create(context.getRequestHeader()); try { AccessAuditContext.doAs(connectionIdentity, remoteAddress, new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { final CompletedCallback callback = new CompletedCallback(response, context, resultHandler); doExecute(operation, attachmentsLength, context, callback); return null; } }); } catch (PrivilegedActionException e) { throw e.getException(); } } }, clientRequestExecutor); }
@Override public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<ModelNode> resultHandler, final ManagementRequestContext<Void> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling ExecuteRequest for %d", context.getOperationId()); InetSocketAddress peerSocketAddress = channelAssociation.getChannel().getConnection().getPeerAddress(InetSocketAddress.class); final InetAddress remoteAddress = peerSocketAddress != null ? peerSocketAddress.getAddress() : null; final ModelNode operation = new ModelNode(); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_OPERATION); operation.readExternal(input); ProtocolUtils.expectHeader(input, ModelControllerProtocol.PARAM_INPUTSTREAMS_LENGTH); final int attachmentsLength = input.readInt(); context.executeAsync(new ManagementRequestContext.AsyncTask<Void>() { @Override public void execute(final ManagementRequestContext<Void> context) throws Exception { final ManagementResponseHeader response = ManagementResponseHeader.create(context.getRequestHeader()); try { AccessAuditContext.doAs(connectionIdentity, remoteAddress, new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { final CompletedCallback callback = new CompletedCallback(response, context, resultHandler); doExecute(operation, attachmentsLength, context, callback); return null; } }); } catch (PrivilegedActionException e) { throw e.getException(); } } }, clientRequestExecutor); }