@Override public OperationResponse executeAndAttemptLock(Operation operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step) { Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, handler, control, step, true)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override public ModelNode executeReadOnly(ModelNode operation, OperationStepHandler handler, OperationTransactionControl control) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, control, handler)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override public ModelNode executeReadOnly(ModelNode operation, Resource model, OperationStepHandler handler, OperationTransactionControl control) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, model, control, handler)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override @SuppressWarnings("deprecation") public ModelNode joinActiveOperation(ModelNode operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step, int permit) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, handler, control, step, permit)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override public OperationResponse executeAndAttemptLock(Operation operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step) { Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, handler, control, step, true)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override public ModelNode executeReadOnly(ModelNode operation, OperationStepHandler handler, OperationTransactionControl control) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, control, handler)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override public ModelNode executeReadOnly(ModelNode operation, Resource model, OperationStepHandler handler, OperationTransactionControl control) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, model, control, handler)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
@Override @SuppressWarnings("deprecation") public ModelNode joinActiveOperation(ModelNode operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step, int permit) { Function<DomainModelControllerService, ModelNode> function = new Function<DomainModelControllerService, ModelNode>() { @Override public ModelNode apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<ModelNode>) () -> controllerService.executeReadOnlyOperation(operation, handler, control, step, permit)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the argument to the function * @param <T> the type of the argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, R> R privilegedExecution(Function<T, R> function, T t) { return privilegedExecution().execute(function, t); }
@Override public ModelNode execute(Operation operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step) { Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, handler, control, step)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this).getResponseNode(); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the argument to the function * @param <T> the type of the argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, R> R privilegedExecution(Function<T, R> function, T t) { return privilegedExecution().execute(function, t); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the first argument to the function * @param u the second argument to the function * @param <T> the type of the first argument to the function * @param <U> the type of the second argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, U, R> R privilegedExecution(BiFunction<T, U, R> function, T t, U u) { return privilegedExecution().execute(function, t, u); }
@Override public ModelNode execute(Operation operation, OperationMessageHandler handler, OperationTransactionControl control, OperationStepHandler step) { Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, handler, control, step)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this).getResponseNode(); }
/** * Execute the given function, in a privileged block if a security manager is checking. * @param function the function * @param t the first argument to the function * @param u the second argument to the function * @param <T> the type of the first argument to the function * @param <U> the type of the second argument to the function * @param <R> the type of the function return value * @return the return value of the function */ static <T, U, R> R privilegedExecution(BiFunction<T, U, R> function, T t, U u) { return privilegedExecution().execute(function, t, u); }
@Override public ModelNode installSlaveExtensions(List<ModelNode> extensions) { Operation operation = ApplyExtensionsHandler.getOperation(extensions); OperationStepHandler stepHandler = modelNodeRegistration.getOperationHandler(PathAddress.EMPTY_ADDRESS, ApplyExtensionsHandler.OPERATION_NAME); Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, OperationMessageHandler.logging, OperationTransactionControl.COMMIT, stepHandler, false, true)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this).getResponseNode(); }
@Override public ModelNode installSlaveExtensions(List<ModelNode> extensions) { Operation operation = ApplyExtensionsHandler.getOperation(extensions); OperationStepHandler stepHandler = modelNodeRegistration.getOperationHandler(PathAddress.EMPTY_ADDRESS, ApplyExtensionsHandler.OPERATION_NAME); Function<DomainModelControllerService, OperationResponse> function = new Function<DomainModelControllerService, OperationResponse>() { @Override public OperationResponse apply(DomainModelControllerService controllerService) { return InVmAccess.runInVm((PrivilegedAction<OperationResponse>) () -> controllerService.internalExecute(operation, OperationMessageHandler.logging, OperationTransactionControl.COMMIT, stepHandler, false, true)); } }; return SecurityActions.privilegedExecution(function, DomainModelControllerService.this).getResponseNode(); }