geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r240324 - in /geronimo/trunk: etc/ modules/security/src/java/org/apache/geronimo/security/ modules/security/src/java/org/apache/geronimo/security/jacc/ specs/j2ee-jacc/src/java/javax/security/jacc/
Date Fri, 26 Aug 2005 19:50:48 GMT
Author: djencks
Date: Fri Aug 26 12:50:35 2005
New Revision: 240324

URL: http://svn.apache.org/viewcvs?rev=240324&view=rev
Log:
GERONIMO-924  PolicyConfigurationFactory should use TCCL to load the concrete implementation

Modified:
    geronimo/trunk/etc/project.properties
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/SecurityServiceImpl.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/ApplicationPolicyConfigurationManager.java
    geronimo/trunk/specs/j2ee-jacc/src/java/javax/security/jacc/PolicyConfigurationFactory.java

Modified: geronimo/trunk/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?rev=240324&r1=240323&r2=240324&view=diff
==============================================================================
--- geronimo/trunk/etc/project.properties (original)
+++ geronimo/trunk/etc/project.properties Fri Aug 26 12:50:35 2005
@@ -90,7 +90,7 @@
 geronimo_spec_j2ee_version=1.4-rc4
 geronimo_spec_j2ee_connector_version=1.5-rc4
 geronimo_spec_j2ee_deployment_version=1.1-rc4
-geronimo_spec_j2ee_jacc_version=1.0-rc4
+geronimo_spec_j2ee_jacc_version=1.0-rc5-SNAPSHOT
 geronimo_spec_j2ee_management_version=1.0-rc4
 geronimo_spec_javamail_version=1.3.1-rc6-SNAPSHOT
 geronimo_spec_jaxr_version=1.0-rc4

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?rev=240324&r1=240323&r2=240324&view=diff
==============================================================================
--- 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
Fri Aug 26 12:50:35 2005
@@ -75,9 +75,16 @@
         }
 
         policyConfigurationFactory = sysOverRide(policyConfigurationFactory, POLICY_CONFIG_FACTORY);
-        if (policyConfigurationFactory != null)
-            PolicyConfigurationFactory.getPolicyConfigurationFactory();
-
+        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.resolvePath(keyStore), KEYSTORE);
         if (keyStorePassword != null) sysOverRide(keyStorePassword, KEYSTORE_PASSWORD);
 

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/ApplicationPolicyConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/ApplicationPolicyConfigurationManager.java?rev=240324&r1=240323&r2=240324&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/ApplicationPolicyConfigurationManager.java
(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/jacc/ApplicationPolicyConfigurationManager.java
Fri Aug 26 12:50:35 2005
@@ -44,8 +44,17 @@
     private final Map contextIdToPolicyConfigurationMap = new HashMap();
     private final Map roleDesignates;
 
-    public ApplicationPolicyConfigurationManager(Map contextIdToPermissionsMap, Map principalRoleMap,
Map roleDesignates) throws PolicyContextException, ClassNotFoundException {
-        PolicyConfigurationFactory policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
+    public ApplicationPolicyConfigurationManager(Map contextIdToPermissionsMap, Map principalRoleMap,
Map roleDesignates, ClassLoader cl) throws PolicyContextException, ClassNotFoundException
{
+        Thread currentThread = Thread.currentThread();
+        ClassLoader oldClassLoader = currentThread.getContextClassLoader();
+        currentThread.setContextClassLoader(cl);
+        PolicyConfigurationFactory policyConfigurationFactory;
+        try {
+            policyConfigurationFactory = PolicyConfigurationFactory.getPolicyConfigurationFactory();
+        } finally {
+            currentThread.setContextClassLoader(oldClassLoader);
+        }
+
         for (Iterator iterator = contextIdToPermissionsMap.entrySet().iterator(); iterator.hasNext();)
{
             Map.Entry entry = (Map.Entry) iterator.next();
             String contextID = (String) entry.getKey();
@@ -142,8 +151,9 @@
         infoBuilder.addAttribute("contextIdToPermissionsMap", Map.class, true);
         infoBuilder.addAttribute("principalRoleMap", Map.class, true);
         infoBuilder.addAttribute("roleDesignates", Map.class, true);
+        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
         infoBuilder.addInterface(RoleDesignateSource.class);
-        infoBuilder.setConstructor(new String[] {"contextIdToPermissionsMap", "principalRoleMap",
"roleDesignates"});
+        infoBuilder.setConstructor(new String[] {"contextIdToPermissionsMap", "principalRoleMap",
"roleDesignates", "classLoader"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/trunk/specs/j2ee-jacc/src/java/javax/security/jacc/PolicyConfigurationFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/j2ee-jacc/src/java/javax/security/jacc/PolicyConfigurationFactory.java?rev=240324&r1=240323&r2=240324&view=diff
==============================================================================
--- geronimo/trunk/specs/j2ee-jacc/src/java/javax/security/jacc/PolicyConfigurationFactory.java
(original)
+++ geronimo/trunk/specs/j2ee-jacc/src/java/javax/security/jacc/PolicyConfigurationFactory.java
Fri Aug 26 12:50:35 2005
@@ -79,8 +79,9 @@
                         factoryClassName[0] = System.getProperty(FACTORY_NAME);
 
                         if (factoryClassName[0] == null) throw new ClassNotFoundException("Property
" + FACTORY_NAME + " not set");
-
-                        return Class.forName(factoryClassName[0]).newInstance();
+                        Thread currentThread = Thread.currentThread();
+                        ClassLoader tccl = currentThread.getContextClassLoader();
+                        return Class.forName(factoryClassName[0], true, tccl).newInstance();
                     }
                 });
         } catch(PrivilegedActionException pae) {



Mime
View raw message