/** * Initialize the naming components required by {@link javax.naming.spi.NamingManager}. */ public static void initializeNamingManager() { // Setup naming environment final String property = WildFlySecurityManager.getPropertyPrivileged(Context.URL_PKG_PREFIXES, null); if(property == null || property.isEmpty()) { WildFlySecurityManager.setPropertyPrivileged(Context.URL_PKG_PREFIXES, PACKAGE_PREFIXES); } else if(!Arrays.asList(property.split(":")).contains(PACKAGE_PREFIXES)) { WildFlySecurityManager.setPropertyPrivileged(Context.URL_PKG_PREFIXES, PACKAGE_PREFIXES + ":" + property); } try { //If we are reusing the JVM. e.g. in tests we should not set this again if (!NamingManager.hasInitialContextFactoryBuilder()) NamingManager.setInitialContextFactoryBuilder(new InitialContextFactoryBuilder()); } catch (NamingException e) { ROOT_LOGGER.failedToSet(e, "InitialContextFactoryBuilder"); } }
WildFlySecurityManager.setPropertyPrivileged(Constants.ORB_CLASS, ORBImpl.class.getName()); WildFlySecurityManager.setPropertyPrivileged(Constants.ORB_SINGLETON_CLASS, ORBSingleton.class.getName());
WildFlySecurityManager.setPropertyPrivileged(SecurityContextAssociation.SECURITYCONTEXT_THREADLOCAL, "true");
WildFlySecurityManager.setPropertyPrivileged("org.jboss.com.sun.CORBA.ORBUseDynamicStub", "true");
private void setPathProperty(String propertyName, File path) { if (this.launchType == LaunchType.SELF_CONTAINED && path == null) { return; } WildFlySecurityManager.setPropertyPrivileged(propertyName, path.getAbsolutePath()); }
private void setPathProperty(String propertyName, File path) { if (this.launchType == LaunchType.SELF_CONTAINED && path == null) { return; } WildFlySecurityManager.setPropertyPrivileged(propertyName, path.getAbsolutePath()); }
private PrivilegedAction<Void> setConfigurationProviderSystemProperty() { return () -> { if (WildFlySecurityManager.isChecking()) { WildFlySecurityManager.setPropertyPrivileged("javax.security.jacc.PolicyConfigurationFactory.provider", configurationFactory); } else { System.setProperty("javax.security.jacc.PolicyConfigurationFactory.provider", configurationFactory); } return null; }; }
private void setSystemProperty(final String name, final Object value) { if (value != null) { final String currentValue = WildFlySecurityManager.getPropertyPrivileged(name, null); WildFlySecurityManager.setPropertyPrivileged(name, value.toString()); propertiesToReset.put(name, currentValue); } }
private void resetProperties() { final Iterator<Map.Entry<String, String>> iterator = propertiesToReset.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, String> entry = iterator.next(); if (entry.getValue() == null) { WildFlySecurityManager.clearPropertyPrivileged(entry.getKey()); } else { WildFlySecurityManager.setPropertyPrivileged(entry.getKey(), entry.getValue()); } iterator.remove(); } } }
private void setSystemProperty(final String name, final Object value) { if (value != null) { final String currentValue = WildFlySecurityManager.getPropertyPrivileged(name, null); WildFlySecurityManager.setPropertyPrivileged(name, value.toString()); propertiesToReset.put(name, currentValue); } }
private void resetProperties() { final Iterator<Map.Entry<String, String>> iterator = propertiesToReset.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry<String, String> entry = iterator.next(); if (entry.getValue() == null) { WildFlySecurityManager.clearPropertyPrivileged(entry.getKey()); } else { WildFlySecurityManager.setPropertyPrivileged(entry.getKey(), entry.getValue()); } iterator.remove(); } } }
private void setProperty(String name, String value) { if (value != null) { WildFlySecurityManager.setPropertyPrivileged(name, value); } else { WildFlySecurityManager.clearPropertyPrivileged(name); } if (systemPropertyUpdater != null) { systemPropertyUpdater.systemPropertyUpdated(name, value); } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, SysPropValue handback) throws OperationFailedException { if (handback != null) { if (handback.value != null) { WildFlySecurityManager.setPropertyPrivileged(handback.name, handback.value); } else { WildFlySecurityManager.clearPropertyPrivileged(handback.name); } systemPropertyUpdater.systemPropertyUpdated(handback.name, handback.value); } }
private void setProperty(String name, String value) { if (value != null) { WildFlySecurityManager.setPropertyPrivileged(name, value); } else { WildFlySecurityManager.clearPropertyPrivileged(name); } if (systemPropertyUpdater != null) { systemPropertyUpdater.systemPropertyUpdated(name, value); } }
private void setProperty(String name, String value) { if (value != null) { WildFlySecurityManager.setPropertyPrivileged(name, value); } else { WildFlySecurityManager.clearPropertyPrivileged(name); } if (systemPropertyUpdater != null) { systemPropertyUpdater.systemPropertyUpdated(name, value); } }
@Override public void handleRollback(OperationContext context, ModelNode operation) { if (applyToRuntime) { WildFlySecurityManager.setPropertyPrivileged(name, oldValue); if (systemPropertyUpdater != null) { systemPropertyUpdater.systemPropertyUpdated(name, oldValue); } } else if (reload) { context.revertReloadRequired(); } } });
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, SysPropValue handback) throws OperationFailedException { if (handback != null) { if (handback.value != null) { WildFlySecurityManager.setPropertyPrivileged(handback.name, handback.value); } else { WildFlySecurityManager.clearPropertyPrivileged(handback.name); } systemPropertyUpdater.systemPropertyUpdated(handback.name, handback.value); } }
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode valueToRevert, SysPropValue handback) throws OperationFailedException { if (handback != null) { if (handback.value != null) { WildFlySecurityManager.setPropertyPrivileged(handback.name, handback.value); } else { WildFlySecurityManager.clearPropertyPrivileged(handback.name); } systemPropertyUpdater.systemPropertyUpdated(handback.name, handback.value); } }
void restoreEnvironment() { final Iterator<Map.Entry<String, String>> iter = propertiesToReset.entrySet().iterator(); while (iter.hasNext()) { final Map.Entry<String, String> entry = iter.next(); final String value = entry.getValue(); if (value == null) { WildFlySecurityManager.clearPropertyPrivileged(entry.getKey()); } else { WildFlySecurityManager.setPropertyPrivileged(entry.getKey(), value); } iter.remove(); } StdioContext.setStdioContextSelector(new SimpleStdioContextSelector(defaultContexts.getStdioContext())); restoreLogContextSelector(); } }
@Override public void handleRollback(OperationContext context, ModelNode operation) { if (applyToRuntime) { WildFlySecurityManager.setPropertyPrivileged(name, oldValue); if (systemPropertyUpdater != null) { systemPropertyUpdater.systemPropertyUpdated(name, oldValue); } } else if (reload) { context.revertReloadRequired(); } } });