geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r743457 - /geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java
Date Wed, 11 Feb 2009 19:28:28 GMT
Author: gawor
Date: Wed Feb 11 19:28:28 2009
New Revision: 743457

URL: http://svn.apache.org/viewvc?rev=743457&view=rev
Log:
revert 741735. must set Policy first before calling PolicyConfigurationFactory.getPolicyConfigurationFactory()
(GERONIMO-4037)

Modified:
    geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java

Modified: geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java?rev=743457&r1=743456&r2=743457&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/SecurityServiceImpl.java
Wed Feb 11 19:28:28 2009
@@ -59,21 +59,6 @@
         ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerSOAPMessage(),
true);
         ConfigurationUtil.registerPolicyContextHandler(new PolicyContextHandlerHttpServletRequest(),
true);
 
-        //Initialize PolicyConfigurationFactory before registering the GeronimoPolicy to
the security system.
-        //So in the process of initializing PolicyConfigurationFactory, default Policy Object
is still in effect
-        //In this way, we could avoid the infinite loop between the policy checking and loading
PolicyConfigurationFactory
-        policyConfigurationFactory = sysOverRide(policyConfigurationFactory, POLICY_CONFIG_FACTORY);
-        if (policyConfigurationFactory != null) {
-            Thread currentThread = Thread.currentThread();
-            ClassLoader oldClassLoader = currentThread.getContextClassLoader();
-            currentThread.setContextClassLoader(classLoader);
-            try {
-                PolicyConfigurationFactory.getPolicyConfigurationFactory();
-            } finally {
-                currentThread.setContextClassLoader(oldClassLoader);
-            }
-        }
-
         if (!POLICY_INSTALLED) {
             policyProvider = sysOverRide(policyProvider, POLICY_PROVIDER);
 
@@ -86,6 +71,17 @@
             POLICY_INSTALLED = true;
         }
 
+        policyConfigurationFactory = sysOverRide(policyConfigurationFactory, POLICY_CONFIG_FACTORY);
+        if (policyConfigurationFactory != null) {
+            Thread currentThread = Thread.currentThread();
+            ClassLoader oldClassLoader = currentThread.getContextClassLoader();
+            currentThread.setContextClassLoader(classLoader);
+            try {
+                PolicyConfigurationFactory.getPolicyConfigurationFactory();
+            } finally {
+                currentThread.setContextClassLoader(oldClassLoader);
+            }
+        }
         if (keyStore != null) sysOverRide(serverInfo.resolveServerPath(keyStore), KEYSTORE);
         if (keyStorePassword != null) sysOverRide(keyStorePassword, KEYSTORE_PASSWORD);
 



Mime
View raw message