java.lang.System.getSecurityManager-sorg.wildfly.security.manager.WildFlySecurityManager



Project wildfly/wildfly in file ...ector.services.workmanager.WorkManagerService.java (2013-05-07)
@@ -23,7 +23,6 @@
 package org.jboss.as.connector.services.workmanager;
 
 import static java.lang.System.getProperty;
-import static java.lang.System.getSecurityManager;
 import static java.security.AccessController.doPrivileged;
 import static org.jboss.as.connector.logging.ConnectorLogger.ROOT_LOGGER;
 
@@ -43,6 +42,7 @@ import org.jboss.msc.service.StopContext;
 import org.jboss.msc.value.InjectedValue;
 import org.jboss.threads.BlockingExecutor;
 import org.jboss.tm.JBossXATerminator;
+import org.wildfly.security.manager.WildFlySecurityManager;
 
 /**
  * A WorkManager Service.
@@ -90,7 +90,7 @@ public final class WorkManagerService implements Service<WorkManager> {
         this.value.setXATerminator(new XATerminatorImpl(xaTerminator.getValue()));
 
         // TODO - Remove and do proper integration (IronJacamar 1.1)
-        String callbackProperties = getSecurityManager() == null ? getProperty("callback.properties") : doPrivileged(new ReadPropertyAction("callback.properties"));
+        String callbackProperties = ! WildFlySecurityManager.isChecking() ? getProperty("callback.properties") : doPrivileged(new ReadPropertyAction("callback.properties"));
         if (callbackProperties != null) {
             try {
                 DefaultCallback defaultCallback = new DefaultCallback(callbackProperties);
Project wildfly/wildfly in file ...ontroller.interfaces.OverallInterfaceCriteria.java (2013-05-07)
@@ -36,9 +36,9 @@ import java.util.Set;
 
 import org.jboss.as.controller.ControllerLogger;
 import org.wildfly.security.manager.ReadPropertyAction;
+import org.wildfly.security.manager.WildFlySecurityManager;
 
 import static java.lang.System.getProperty;
-import static java.lang.System.getSecurityManager;
 import static java.security.AccessController.doPrivileged;
 
 /**
@@ -159,7 +159,7 @@ public final class OverallInterfaceCriteria implements InterfaceCriteria {
     }
 
     private static Boolean getBoolean(final String property) {
-        final String value = getSecurityManager() == null ? getProperty(property) : doPrivileged(new ReadPropertyAction(property));
+        final String value = ! WildFlySecurityManager.isChecking() ? getProperty(property) : doPrivileged(new ReadPropertyAction(property));
         return value == null ? null : value.equalsIgnoreCase("true");
     }
 
Project wildfly/wildfly in file ...boss.as.controller.interfaces.SecurityActions.java (2013-05-07)
@@ -22,10 +22,10 @@
 
 package org.jboss.as.controller.interfaces;
 
-import static java.lang.System.getSecurityManager;
 import static java.security.AccessController.doPrivileged;
 
 import org.wildfly.security.manager.GetBooleanAction;
+import org.wildfly.security.manager.WildFlySecurityManager;
 
 /**
  * Security actions to perform possibly privileged operations.  No methods in
@@ -36,6 +36,6 @@ import org.wildfly.security.manager.GetBooleanAction;
 class SecurityActions {
 
     static boolean getBoolean(String systemProperty) {
-        return getSecurityManager() == null ? Boolean.getBoolean(systemProperty) : doPrivileged(new GetBooleanAction(systemProperty));
+        return ! WildFlySecurityManager.isChecking() ? Boolean.getBoolean(systemProperty) : doPrivileged(new GetBooleanAction(systemProperty));
     }
 }
Project wildfly/wildfly in file ...s.as.controller.persistence.ConfigurationFile.java (2013-05-07)
@@ -19,7 +19,6 @@
 package org.jboss.as.controller.persistence;
 
 import static java.lang.System.getProperty;
-import static java.lang.System.getSecurityManager;
 import static java.security.AccessController.doPrivileged;
 import static org.jboss.as.controller.ControllerMessages.MESSAGES;
 
@@ -38,6 +37,7 @@ import java.util.regex.Pattern;
 
 import org.jboss.as.controller.persistence.ConfigurationPersister.SnapshotInfo;
 import org.wildfly.security.manager.ReadPropertyAction;
+import org.wildfly.security.manager.WildFlySecurityManager;
 
 /**
  * Encapsulates the configuration file and manages its history
@@ -510,7 +510,7 @@ public class ConfigurationFile {
     }
 
     private String getStringProperty(final String name) {
-        return getSecurityManager() == null ? getProperty(name) : doPrivileged(new ReadPropertyAction(name));
+        return ! WildFlySecurityManager.isChecking() ? getProperty(name) : doPrivileged(new ReadPropertyAction(name));
     }
 
     private void deleteRecursive(final File file) {
Project wildfly/wildfly in file ...rg.jboss.as.controller.remote.SecurityActions.java (2013-05-07)
@@ -28,9 +28,9 @@ import javax.security.auth.Subject;
 
 import org.jboss.as.controller.security.SecurityContext;
 import org.wildfly.security.manager.ReadPropertyAction;
+import org.wildfly.security.manager.WildFlySecurityManager;
 
 import static java.lang.System.getProperty;
-import static java.lang.System.getSecurityManager;
 import static java.security.AccessController.doPrivileged;
 
 /**
@@ -43,7 +43,7 @@ import static java.security.AccessController.doPrivileged;
 class SecurityActions {
 
     static String getSystemProperty(final String key, final String defaultValue) {
-        return getSecurityManager() == null ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue));
+        return ! WildFlySecurityManager.isChecking() ? getProperty(key, defaultValue) : doPrivileged(new ReadPropertyAction(key, defaultValue));
     }
 
     static void setSecurityContextSubject(final Subject subject) {