Source:
public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<Void> resultHandler, final ManagementRequestContext<ExecuteRequestContext> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling transactional ExecuteRequest for %d", context.getOperationId()); final ExecutableRequest executableRequest = ExecutableRequest.parse(input, channelAssociation); PropagatedIdentity propagatedIdentity = executableRequest.propagatedIdentity; final SecurityIdentity securityIdentity = propagatedIdentity != null ? propagatedIdentity.securityIdentity : null; final InetAddress remoteAddress = propagatedIdentity != null ? propagatedIdentity.inetAddress : null; final PrivilegedAction<Void> action = new PrivilegedAction<Void>() { @Override public Void run() { doExecute(executableRequest.operation, executableRequest.attachmentsLength, context); return null; } }; final ExecuteRequestContext executeRequestContext = context.getAttachment(); executeRequestContext.initialize(context); @SuppressWarnings("deprecation") AsyncTask<TransactionalProtocolOperationHandler.ExecuteRequestContext> task = new ManagementRequestContext.MultipleResponseAsyncTask<TransactionalProtocolOperationHandler.ExecuteRequestContext>() { @Override public void execute(final ManagementRequestContext<ExecuteRequestContext> context) throws Exception { if (executableRequest.inVmCall && securityIdentity == null) { final Supplier<Void> inVmDoAs = new Supplier<Void>() { @Override public Void get() { return InVmAccess.runInVm((PrivilegedAction<Void>) () -> { AccessAuditContext.doAs(false, null, remoteAddress, action); return null; }); } }; privilegedExecution().execute(inVmDoAs); } else { final Supplier<Void> doAs = new Supplier<Void>() { @Override public Void get() { AccessAuditContext.doAs(securityIdentity != null, securityIdentity, remoteAddress, action); return null; } }; privilegedExecution().execute(doAs); } } @Override public ManagementProtocolHeader getCurrentRequestHeader() { ManagementRequestContext current = executeRequestContext.responseChannel; return current == null ? null : current.getRequestHeader(); } }; context.executeAsync(task); }

Target:
public void handleRequest(final DataInput input, final ActiveOperation.ResultHandler<Void> resultHandler, final ManagementRequestContext<ExecuteRequestContext> context) throws IOException { ControllerLogger.MGMT_OP_LOGGER.tracef("Handling transactional ExecuteRequest for %d", context.getOperationId()); final ExecutableRequest executableRequest = ExecutableRequest.parse(input, channelAssociation); PropagatedIdentity propagatedIdentity = executableRequest.propagatedIdentity; final SecurityIdentity securityIdentity = propagatedIdentity != null ? propagatedIdentity.securityIdentity : null; final InetAddress remoteAddress = propagatedIdentity != null ? propagatedIdentity.inetAddress : null; final PrivilegedAction<Void> action = new PrivilegedAction<Void>() { @Override public Void run() { doExecute(executableRequest.operation, executableRequest.attachmentsLength, context); return null; } }; final ExecuteRequestContext executeRequestContext = context.getAttachment(); executeRequestContext.initialize(context); @SuppressWarnings("deprecation") AsyncTask<TransactionalProtocolOperationHandler.ExecuteRequestContext> task = new ManagementRequestContext.MultipleResponseAsyncTask<TransactionalProtocolOperationHandler.ExecuteRequestContext>() { @Override public void execute(final ManagementRequestContext<ExecuteRequestContext> context) throws Exception { final Supplier<Void> execution = new Supplier<Void>() { @Override public Void get() { if (executableRequest.inVmCall && securityIdentity == null) { return InVmAccess.runInVm((PrivilegedAction<Void>) () -> { AccessAuditContext.doAs(false, null, remoteAddress, action); return null; }); } else { AccessAuditContext.doAs(securityIdentity != null, securityIdentity, remoteAddress, action); return null; } } }; privilegedExecution().execute(execution); } @Override public ManagementProtocolHeader getCurrentRequestHeader() { ManagementRequestContext current = executeRequestContext.responseChannel; return current == null ? null : current.getRequestHeader(); } }; context.executeAsync(task); }