@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); }
env = SecurityActions.getSystemEnvironment(); SecurityActions.setSystemProperty(HOME_DIR, this.homeDir.getAbsolutePath()); @SuppressWarnings("deprecation") String deprecatedModDir = MODULES_DIR; SecurityActions.setSystemProperty(deprecatedModDir, this.modulesDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_BASE_DIR, this.domainBaseDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_CONFIG_DIR, this.domainConfigurationDir.getAbsolutePath()); final String defaultHostConfig = SecurityActions.getSystemProperty(JBOSS_HOST_DEFAULT_CONFIG, "host.xml"); hostConfigurationFile = new ConfigurationFile(domainConfigurationDir, defaultHostConfig, initialHostConfig == null ? hostConfig : initialHostConfig, initialHostConfig == null); final String defaultDomainConfig = SecurityActions.getSystemProperty(JBOSS_DOMAIN_DEFAULT_CONFIG, "domain.xml"); domainConfigurationFile = new ConfigurationFile(domainConfigurationDir, defaultDomainConfig, initialDomainConfig == null ? domainConfig : initialDomainConfig, initialDomainConfig == null); SecurityActions.setSystemProperty(DOMAIN_DATA_DIR, this.domainDataDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_CONTENT_DIR, this.domainContentDir.getAbsolutePath()); SecurityActions.setSystemProperty(deprecatedDepDir, this.domainContentDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_LOG_DIR, this.domainLogDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_SERVERS_DIR, this.domainServersDir.getAbsolutePath()); SecurityActions.setSystemProperty(DOMAIN_TEMP_DIR, this.domainTempDir.getAbsolutePath());
SecurityActions.setSystemProperty(HostControllerEnvironment.JBOSS_DOMAIN_MASTER_ADDRESS, value); SecurityActions.setSystemProperty(HostControllerEnvironment.JBOSS_DOMAIN_MASTER_PORT, value); value = arg.substring(idx + 1, arg.length()); SecurityActions.setSystemProperty(name, value); hostSystemProperties.put(name, value); } else if (arg.startsWith(CommandLineConstants.PUBLIC_BIND_ADDRESS)) { SecurityActions.setSystemProperty(propertyName, value); } else if (arg.startsWith(CommandLineConstants.DEFAULT_MULTICAST_ADDRESS)) { SecurityActions.setSystemProperty(HostControllerEnvironment.JBOSS_DEFAULT_MULTICAST_ADDRESS, value); } else if (arg.equals(CommandLineConstants.MODULE_PATH)) { modulePath = checkValueIsNotAnArg(arg, args[++i]); productConfig = new ProductConfig(Module.getBootModuleLoader(), SecurityActions.getSystemProperty(HostControllerEnvironment.HOME_DIR), hostSystemProperties); return new HostControllerEnvironment(hostSystemProperties, isRestart, modulePath, pmAddress, pmPort, pcSocketConfig.getBindAddress(), pcSocketConfig.getBindPort(), defaultJVM,
private static String usageNote() { boolean isWindows = (SecurityActions.getSystemProperty("os.name")).toLowerCase(Locale.ENGLISH).contains("windows"); String command = isWindows ? "domain" : "domain.sh"; return MESSAGES.usageNote(command); }
private static boolean processProperties(final String arg, final String urlSpec, Map<String, String> hostSystemProperties) { URL url = null; try { url = makeURL(urlSpec); Properties props = new Properties(); props.load(url.openConnection().getInputStream()); SecurityActions.getSystemProperties().putAll(props); for (Map.Entry<Object, Object> entry : props.entrySet()) { hostSystemProperties.put((String)entry.getKey(), (String)entry.getValue()); } return true; } catch (MalformedURLException e) { System.err.println(MESSAGES.malformedUrl(arg, usageNote())); return false; } catch (IOException e) { System.err.println(MESSAGES.unableToLoadProperties(url, usageNote())); return false; } }
private PCSocketConfig() { boolean preferIPv6 = Boolean.valueOf(SecurityActions.getSystemProperty("java.net.preferIPv6Addresses", "false")); this.defaultBindAddress = preferIPv6 ? "::1" : "127.0.0.1"; UnknownHostException toCache = null; try { bindAddress = InetAddress.getByName(defaultBindAddress); } catch (UnknownHostException e) { try { bindAddress = InetAddressUtil.getLocalHost(); } catch (UnknownHostException uhe) { toCache = uhe; } } uhe = toCache; }
@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); }
} else { command.add("-Dorg.jboss.boot.log.file=" + getAbsolutePath(new File(logDir), "boot.log")); final String fileName = SecurityActions.getSystemProperty("logging.configuration"); if (fileName == null) { path = "file:" + getAbsolutePath(environment.getDomainConfigurationDir(), "logging.properties");
@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); }