geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r154806 - geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java
Date Tue, 22 Feb 2005 06:48:25 GMT
Author: jgenender
Date: Mon Feb 21 22:48:24 2005
New Revision: 154806

URL: http://svn.apache.org/viewcvs?view=rev&rev=154806
Log:
Added one time policy setting rule

Modified:
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java?view=diff&r1=154805&r2=154806
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java
Mon Feb 21 22:48:24 2005
@@ -40,6 +40,8 @@
  */
 public class SecurityServiceImpl {
 
+    public static boolean POLICY_INSTALLED = false;
+
     private final Log log = LogFactory.getLog(SecurityServiceImpl.class);
 
     /**
@@ -68,16 +70,20 @@
         /**
          * javax.security.jacc.policy.provider gets preference over policyProvider
          */
-        String sysProvider = System.getProperty("javax.security.jacc.policy.provider");
-        if (sysProvider != null)
-            policyProvider = sysProvider;
-
-        if (policyProvider != null) {
-            System.setProperty("javax.security.jacc.policy.provider", policyProvider);
-            Policy customPolicy = (Policy) classLoader.loadClass(policyProvider).newInstance();
-            Policy.setPolicy(customPolicy);
-        } else {
-            Policy.setPolicy(new GeronimoPolicy());
+
+        if (!POLICY_INSTALLED){
+            String sysProvider = System.getProperty("javax.security.jacc.policy.provider");
+            if (sysProvider != null)
+                policyProvider = sysProvider;
+
+            if (policyProvider != null) {
+                System.setProperty("javax.security.jacc.policy.provider", policyProvider);
+                Policy customPolicy = (Policy) classLoader.loadClass(policyProvider).newInstance();
+                Policy.setPolicy(customPolicy);
+            } else {
+                Policy.setPolicy(new GeronimoPolicy());
+            }
+            POLICY_INSTALLED = true;
         }
 
         PolicyConfigurationFactory.getPolicyConfigurationFactory();



Mime
View raw message