geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r344301 - in /geronimo/trunk/modules: client/src/java/org/apache/geronimo/client/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty/src/java/org/apache/geronimo/jet...
Date Tue, 15 Nov 2005 03:50:33 GMT
Author: djencks
Date: Mon Nov 14 19:50:14 2005
New Revision: 344301

URL: http://svn.apache.org/viewcvs?rev=344301&view=rev
Log:
GERONIMO-1172.  Use configuration classloader to load principals.  Also rename our principal info classes to avoid name conflict with java.security.Principal

Added:
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipalInfo.java
      - copied, changed from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipal.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/PrincipalInfo.java
      - copied, changed from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/Principal.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipalInfo.java
      - copied, changed from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipal.java
Removed:
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipal.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/Principal.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipal.java
Modified:
    geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java
    geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
    geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java
    geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/DefaultPrincipal.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/AutoMapAssistant.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java
    geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/util/ConfigurationUtil.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java

Modified: geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java (original)
+++ geronimo/trunk/modules/client/src/java/org/apache/geronimo/client/AppClientContainer.java Mon Nov 14 19:50:14 2005
@@ -79,7 +79,7 @@
             callbackHandlerClass = null;
         }
         if (defaultPrincipal != null) {
-            defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal);
+            defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, classLoader);
         } else {
             defaultSubject = null;
         }

Modified: geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Mon Nov 14 19:50:14 2005
@@ -385,7 +385,7 @@
 
             //look for application plan security config
             if (geronimoApplication != null && geronimoApplication.isSetSecurity()) {
-                SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(geronimoApplication.getSecurity());
+                SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(geronimoApplication.getSecurity(), cl);
                 earContext.setSecurityConfiguration(securityConfiguration);
             }
 

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon Nov 14 19:50:14 2005
@@ -426,7 +426,7 @@
             if (!gerWebApp.isSetSecurityRealmName()) {
                 throw new DeploymentException("You have supplied a security configuration for web app " + module.getName() + " but no security-realm-name to allow login");
             }
-            SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(gerWebApp.getSecurity());
+            SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(gerWebApp.getSecurity(), cl);
             earContext.setSecurityConfiguration(securityConfiguration);
         }
     }

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java Mon Nov 14 19:50:14 2005
@@ -258,7 +258,7 @@
             //set the JAASJettyRealm as our realm.
             JAASJettyRealm realm = new JAASJettyRealm(realmName, securityRealmName);
             setRealm(realm);
-            this.securityInterceptor = new SecurityContextBeforeAfter(interceptor, index++, index++, policyContextID, defaultPrincipal, authenticator, checkedPermissions, excludedPermissions, roleDesignates, realm);
+            this.securityInterceptor = new SecurityContextBeforeAfter(interceptor, index++, index++, policyContextID, defaultPrincipal, authenticator, checkedPermissions, excludedPermissions, roleDesignates, realm, classLoader);
             interceptor = this.securityInterceptor;
         } else {
             securityInterceptor = null;
@@ -359,7 +359,7 @@
 
         // No more logging will occur for this ClassLoader. Inform the LogFactory to avoid a memory leak.
         LogFactory.release(webClassLoader);
-        
+
         log.info("JettyWebAppContext stopped");
     }
 

Modified: geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java (original)
+++ geronimo/trunk/modules/jetty/src/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java Mon Nov 14 19:50:14 2005
@@ -77,14 +77,14 @@
                                       PermissionCollection checkedPermissions,
                                       PermissionCollection excludedPermissions,
                                       Map roleDesignates,
-                                      UserRealm realm)
+                                      UserRealm realm, ClassLoader classLoader)
     {
         this.next = next;
         this.policyContextIDIndex = policyContextIDIndex;
         this.webAppContextIndex = webAppContextIndex;
         this.policyContextID = policyContextID;
 
-        this.defaultPrincipal = generateDefaultPrincipal(defaultPrincipal);
+        this.defaultPrincipal = generateDefaultPrincipal(defaultPrincipal, classLoader);
         this.roleDesignates = roleDesignates;
         this.checked = checkedPermissions;
         this.excludedPermissions = excludedPermissions;
@@ -294,9 +294,10 @@
      * Generate the default principal from the security config.
      *
      * @param defaultPrincipal The Geronimo security configuration.
+     * @param classLoader
      * @return the default principal
      */
-    protected JAASJettyPrincipal generateDefaultPrincipal(DefaultPrincipal defaultPrincipal) throws GeronimoSecurityException {
+    protected JAASJettyPrincipal generateDefaultPrincipal(DefaultPrincipal defaultPrincipal, ClassLoader classLoader) throws GeronimoSecurityException {
 
         if (defaultPrincipal == null) {
             throw new GeronimoSecurityException("Unable to generate default principal");
@@ -304,7 +305,7 @@
 
         try {
             JAASJettyPrincipal result = new JAASJettyPrincipal("default");
-            Subject defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal);
+            Subject defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, classLoader);
 
             result.setSubject(defaultSubject);
 

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java Mon Nov 14 19:50:14 2005
@@ -41,7 +41,7 @@
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
@@ -223,7 +223,7 @@
 //        config.setProperty("LoginModule.1.REQUIRED", propertiesLMName.getCanonicalName());
 //        propertiesRealmGBean.setAttribute("loginModuleConfiguration", config);
         propertiesRealmGBean.setReferencePattern("LoginModuleConfiguration", testUseName);
-        Principal.PrincipalEditor principalEditor = new Principal.PrincipalEditor();
+        PrincipalInfo.PrincipalEditor principalEditor = new PrincipalInfo.PrincipalEditor();
         principalEditor.setAsText("metro,org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal,false");
         propertiesRealmGBean.setAttribute("defaultPrincipal", principalEditor.getValue());
 

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java (original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java Mon Nov 14 19:50:14 2005
@@ -33,7 +33,7 @@
 import javax.security.jacc.WebUserDataPermission;
 
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.deploy.Role;
 import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
@@ -57,15 +57,15 @@
         securityConfig.setUseContextHandler(false);
 
         DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
-        Principal principal = new Principal("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal", "izumi", false);
-        defaultPrincipal.setPrincipal(principal);
+        PrincipalInfo principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal", "izumi", false);
+        defaultPrincipal.setPrincipal(principalInfo);
 
         securityConfig.setDefaultPrincipal(defaultPrincipal);
 
         Role role = new Role();
         role.setRoleName("content-administrator");
-        principal = new Principal("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal", "it", false);
-        role.getPrincipals().add(principal);
+        principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal", "it", false);
+        role.getPrincipals().add(principalInfo);
 
         securityConfig.getRoleMappings().put(role.getRoleName(), role);
 
@@ -180,9 +180,9 @@
     }
 
     //copied from SecurityBuilder
-    public static void buildPrincipalRoleMap(Security security, Map roleDesignates, Map principalRoleMap) {
+    public void buildPrincipalRoleMap(Security security, Map roleDesignates, Map principalRoleMap) {
         Map roleToPrincipalMap = new HashMap();
-        SecurityBuilder.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap);
+        SecurityBuilder.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, getClass().getClassLoader());
         invertMap(roleToPrincipalMap, principalRoleMap);
     }
 

Modified: geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java (original)
+++ geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java Mon Nov 14 19:50:14 2005
@@ -28,9 +28,9 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deploy.DistinguishedName;
-import org.apache.geronimo.security.deploy.LoginDomainPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
-import org.apache.geronimo.security.deploy.RealmPrincipal;
+import org.apache.geronimo.security.deploy.LoginDomainPrincipalInfo;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
+import org.apache.geronimo.security.deploy.RealmPrincipalInfo;
 import org.apache.geronimo.security.deploy.Role;
 import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.jaas.NamedUsernamePasswordCredential;
@@ -52,16 +52,16 @@
  */
 public class SecurityBuilder {
 
-    public static SecurityConfiguration buildSecurityConfiguration(GerSecurityType securityType) {
+    public static SecurityConfiguration buildSecurityConfiguration(GerSecurityType securityType, ClassLoader classLoader) {
         Security security = buildSecurityConfig(securityType);
-        return buildSecurityConfiguration(security);
+        return buildSecurityConfiguration(security, classLoader);
     }
 
-    public static SecurityConfiguration buildSecurityConfiguration(Security security) {
+    public static SecurityConfiguration buildSecurityConfiguration(Security security, ClassLoader classLoader) {
         Map roleDesignates = new HashMap();
         Map principalRoleMap = new HashMap();
         Map roleToPrincipalMap = new HashMap();
-        buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap);
+        buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, classLoader);
         invertMap(roleToPrincipalMap, principalRoleMap);
         return new SecurityConfiguration(principalRoleMap, roleDesignates, security.getDefaultPrincipal(), security.getDefaultRole(), security.isDoAsCurrentCaller(), security.isUseContextHandler());
     }
@@ -85,7 +85,7 @@
         return principalRoleMapping;
     }
 
-    public static void buildRolePrincipalMap(Security security, Map roleDesignates, Map roleToPrincipalMap) {
+    public static void buildRolePrincipalMap(Security security, Map roleDesignates, Map roleToPrincipalMap, ClassLoader classLoader) {
 
         Iterator roleMappings = security.getRoleMappings().values().iterator();
         while (roleMappings.hasNext()) {
@@ -97,8 +97,8 @@
 
             Iterator realmPrincipals = role.getRealmPrincipals().iterator();
             while (realmPrincipals.hasNext()) {
-                RealmPrincipal realmPrincipal = (RealmPrincipal) realmPrincipals.next();
-                java.security.Principal principal = ConfigurationUtil.generateRealmPrincipal(realmPrincipal.getRealm(), realmPrincipal.getDomain(), realmPrincipal);
+                RealmPrincipalInfo realmPrincipal = (RealmPrincipalInfo) realmPrincipals.next();
+                java.security.Principal principal = ConfigurationUtil.generateRealmPrincipal(realmPrincipal.getRealm(), realmPrincipal.getDomain(), realmPrincipal, classLoader);
 
                 principalSet.add(principal);
                 if (realmPrincipal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
@@ -106,8 +106,8 @@
 
             Iterator domainPrincipals = role.getLoginDomainPrincipals().iterator();
             while (domainPrincipals.hasNext()) {
-                LoginDomainPrincipal domainPrincipal = (LoginDomainPrincipal) domainPrincipals.next();
-                java.security.Principal principal = ConfigurationUtil.generateDomainPrincipal(domainPrincipal.getDomain(), domainPrincipal);
+                LoginDomainPrincipalInfo domainPrincipal = (LoginDomainPrincipalInfo) domainPrincipals.next();
+                java.security.Principal principal = ConfigurationUtil.generateDomainPrincipal(domainPrincipal.getDomain(), domainPrincipal, classLoader);
 
                 principalSet.add(principal);
                 if (domainPrincipal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
@@ -115,11 +115,11 @@
 
             Iterator principals = role.getPrincipals().iterator();
             while (principals.hasNext()) {
-                Principal plainPrincipal = (Principal) principals.next();
-                java.security.Principal principal = ConfigurationUtil.generatePrincipal(plainPrincipal);
+                PrincipalInfo plainPrincipalInfo = (PrincipalInfo) principals.next();
+                java.security.Principal principal = ConfigurationUtil.generatePrincipal(plainPrincipalInfo, classLoader);
 
                 principalSet.add(principal);
-                if (plainPrincipal.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
+                if (plainPrincipalInfo.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
             }
 
             for (Iterator names = role.getDistinguishedNames().iterator(); names.hasNext();) {
@@ -213,16 +213,16 @@
     }
 
     //used from TSSConfigEditor
-    public static RealmPrincipal buildRealmPrincipal(GerRealmPrincipalType realmPrincipalType) {
-        return new RealmPrincipal(realmPrincipalType.getDomainName(), realmPrincipalType.getRealmName(), realmPrincipalType.getClass1(), realmPrincipalType.getName(), realmPrincipalType.isSetDesignatedRunAs());
+    public static RealmPrincipalInfo buildRealmPrincipal(GerRealmPrincipalType realmPrincipalType) {
+        return new RealmPrincipalInfo(realmPrincipalType.getDomainName(), realmPrincipalType.getRealmName(), realmPrincipalType.getClass1(), realmPrincipalType.getName(), realmPrincipalType.isSetDesignatedRunAs());
     }
 
-    public static LoginDomainPrincipal buildDomainPrincipal(GerLoginDomainPrincipalType domainPrincipalType) {
-        return new LoginDomainPrincipal(domainPrincipalType.getDomainName(), domainPrincipalType.getClass1(), domainPrincipalType.getName(), domainPrincipalType.isSetDesignatedRunAs());
+    public static LoginDomainPrincipalInfo buildDomainPrincipal(GerLoginDomainPrincipalType domainPrincipalType) {
+        return new LoginDomainPrincipalInfo(domainPrincipalType.getDomainName(), domainPrincipalType.getClass1(), domainPrincipalType.getName(), domainPrincipalType.isSetDesignatedRunAs());
     }
 
-    public static Principal buildPrincipal(GerPrincipalType principalType) {
-        return new Principal(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
+    public static PrincipalInfo buildPrincipal(GerPrincipalType principalType) {
+        return new PrincipalInfo(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
     }
 
     public static GBeanData configureApplicationPolicyManager(ObjectName name, Map contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) {

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/DefaultPrincipal.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/DefaultPrincipal.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/DefaultPrincipal.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/DefaultPrincipal.java Mon Nov 14 19:50:14 2005
@@ -24,16 +24,16 @@
  * @version $Rev$ $Date$
  */
 public class DefaultPrincipal implements Serializable {
-    private Principal principal;
+    private PrincipalInfo principalInfo;
 
     private Set namedUserPasswordCredentials;
 
-    public Principal getPrincipal() {
-        return principal;
+    public PrincipalInfo getPrincipal() {
+        return principalInfo;
     }
 
-    public void setPrincipal(Principal principal) {
-        this.principal = principal;
+    public void setPrincipal(PrincipalInfo principalInfo) {
+        this.principalInfo = principalInfo;
     }
 
     public Set getNamedUserPasswordCredentials() {

Copied: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipalInfo.java (from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipal.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipalInfo.java?p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipalInfo.java&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipal.java&r1=344264&r2=344301&rev=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipal.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/LoginDomainPrincipalInfo.java Mon Nov 14 19:50:14 2005
@@ -25,13 +25,13 @@
 /**
  * @version $Rev: 154957 $ $Date: 2005-02-22 21:07:36 -0800 (Tue, 22 Feb 2005) $
  */
-public class LoginDomainPrincipal extends Principal {
+public class LoginDomainPrincipalInfo extends PrincipalInfo {
 
     static {
-        PropertyEditorManager.registerEditor(LoginDomainPrincipal.class, LoginDomainPrincipalEditor.class);
+        PropertyEditorManager.registerEditor(LoginDomainPrincipalInfo.class, LoginDomainPrincipalEditor.class);
     }
 
-    public LoginDomainPrincipal(String domainName, String className, String principalName, boolean designatedRunAs) {
+    public LoginDomainPrincipalInfo(String domainName, String className, String principalName, boolean designatedRunAs) {
         super(className, principalName, designatedRunAs);
         this.domainName = domainName;
     }
@@ -50,7 +50,7 @@
                 if (parts.length != 4) {
                     throw new PropertyEditorException("Principal should have the form 'domain,class,name,run-as'");
                 }
-                LoginDomainPrincipal principal = new LoginDomainPrincipal(parts[0], parts[1], parts[2], Boolean.valueOf(parts[3]).booleanValue());
+                LoginDomainPrincipalInfo principal = new LoginDomainPrincipalInfo(parts[0], parts[1], parts[2], Boolean.valueOf(parts[3]).booleanValue());
                 setValue(principal);
             } else {
                 setValue(null);
@@ -58,7 +58,7 @@
         }
 
         public String getAsText() {
-            LoginDomainPrincipal principal = (LoginDomainPrincipal) getValue();
+            LoginDomainPrincipalInfo principal = (LoginDomainPrincipalInfo) getValue();
             if (principal == null) {
                 return null;
             }

Copied: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/PrincipalInfo.java (from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/Principal.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/PrincipalInfo.java?p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/PrincipalInfo.java&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/Principal.java&r1=344264&r2=344301&rev=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/Principal.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/PrincipalInfo.java Mon Nov 14 19:50:14 2005
@@ -26,17 +26,17 @@
 /**
  * @version $Rev$ $Date$
  */
-public class Principal implements Serializable {
+public class PrincipalInfo implements Serializable {
 
     static {
-        PropertyEditorManager.registerEditor(Principal.class, PrincipalEditor.class);
+        PropertyEditorManager.registerEditor(PrincipalInfo.class, PrincipalEditor.class);
     }
 
     private final String className;
     private final String principalName;
     private final boolean designatedRunAs;
 
-    public Principal(String className, String principalName, boolean designatedRunAs) {
+    public PrincipalInfo(String className, String principalName, boolean designatedRunAs) {
         this.className = className;
         this.principalName = principalName;
         this.designatedRunAs = designatedRunAs;
@@ -62,19 +62,19 @@
                 if (parts.length != 3) {
                     throw new PropertyEditorException("Principal should have the form 'name,class,run-as'");
                 }
-                Principal principal = new Principal(parts[0], parts[1], Boolean.valueOf(parts[2]).booleanValue());
-                setValue(principal);
+                PrincipalInfo principalInfo = new PrincipalInfo(parts[0], parts[1], Boolean.valueOf(parts[2]).booleanValue());
+                setValue(principalInfo);
             } else {
                 setValue(null);
             }
         }
 
         public String getAsText() {
-            Principal principal = (Principal) getValue();
-            if (principal == null) {
+            PrincipalInfo principalInfo = (PrincipalInfo) getValue();
+            if (principalInfo == null) {
                 return null;
             }
-            return principal.getPrincipalName() + "," + principal.getClassName() + "," + principal.isDesignatedRunAs();
+            return principalInfo.getPrincipalName() + "," + principalInfo.getClassName() + "," + principalInfo.isDesignatedRunAs();
         }
     }
 }

Copied: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipalInfo.java (from r344264, geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipal.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipalInfo.java?p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipalInfo.java&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipal.java&r1=344264&r2=344301&rev=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipal.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/deploy/RealmPrincipalInfo.java Mon Nov 14 19:50:14 2005
@@ -25,15 +25,15 @@
 /**
  * @version $Rev: 154957 $ $Date: 2005-02-22 21:07:36 -0800 (Tue, 22 Feb 2005) $
  */
-public class RealmPrincipal extends LoginDomainPrincipal {
+public class RealmPrincipalInfo extends LoginDomainPrincipalInfo {
 
     static {
-        PropertyEditorManager.registerEditor(RealmPrincipal.class, RealmPrincipalEditor.class);
+        PropertyEditorManager.registerEditor(RealmPrincipalInfo.class, RealmPrincipalEditor.class);
     }
 
     private final String realm;
 
-    public RealmPrincipal(String realm, String domainName, String className, String principalName, boolean designatedRunAs) {
+    public RealmPrincipalInfo(String realm, String domainName, String className, String principalName, boolean designatedRunAs) {
         super(domainName, className, principalName, designatedRunAs);
         this.realm = realm;
     }
@@ -50,7 +50,7 @@
                 if (parts.length != 5) {
                     throw new PropertyEditorException("Principal should have the form 'domain,realm,class,name,run-as'");
                 }
-                RealmPrincipal principal = new RealmPrincipal(parts[0], parts[1], parts[2], parts[3], Boolean.valueOf(parts[4]).booleanValue());
+                RealmPrincipalInfo principal = new RealmPrincipalInfo(parts[0], parts[1], parts[2], parts[3], Boolean.valueOf(parts[4]).booleanValue());
                 setValue(principal);
             } else {
                 setValue(null);
@@ -58,7 +58,7 @@
         }
 
         public String getAsText() {
-            RealmPrincipal principal = (RealmPrincipal) getValue();
+            RealmPrincipalInfo principal = (RealmPrincipalInfo) getValue();
             if (principal == null) {
                 return null;
             }

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/AutoMapAssistant.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/AutoMapAssistant.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/AutoMapAssistant.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/AutoMapAssistant.java Mon Nov 14 19:50:14 2005
@@ -17,7 +17,7 @@
 package org.apache.geronimo.security.realm;
 
 import org.apache.geronimo.security.deploy.MapOfSets;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 
 
 /**
@@ -43,7 +43,7 @@
      *
      * @return the default principal
      */
-    public Principal getDefaultPrincipal();
+    public PrincipalInfo getDefaultPrincipal();
 
     /**
      * Provides a set of principal class names to be used when automatically

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/realm/GenericSecurityRealm.java Mon Nov 14 19:50:14 2005
@@ -28,7 +28,7 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.jaas.ConfigurationEntryFactory;
 import org.apache.geronimo.security.jaas.client.JaasLoginCoordinator;
 import org.apache.geronimo.security.jaas.server.JaasLoginModuleConfiguration;
@@ -77,7 +77,7 @@
     private JaasLoginModuleConfiguration[] config;
     private final Kernel kernel;
 
-    private final Principal defaultPrincipal;
+    private final PrincipalInfo defaultPrincipalInfo;
 
     private String[] domains;
     private final boolean restrictPrincipalsToServer;
@@ -88,7 +88,7 @@
                                 JaasLoginModuleUse loginModuleUse,
                                 boolean restrictPrincipalsToServer,
                                 boolean wrapPrincipals,
-                                Principal defaultPrincipal,
+                                PrincipalInfo defaultPrincipalInfo,
                                 ServerInfo serverInfo,
                                 ClassLoader classLoader,
                                 Kernel kernel,
@@ -97,7 +97,7 @@
         this.kernel = kernel;
         this.restrictPrincipalsToServer = restrictPrincipalsToServer;
         this.wrapPrincipals = wrapPrincipals;
-        this.defaultPrincipal = defaultPrincipal;
+        this.defaultPrincipalInfo = defaultPrincipalInfo;
         this.loginService = loginService;
 
         Set domainNames = new HashSet();
@@ -137,8 +137,8 @@
      *
      * @return the default principal
      */
-    public Principal getDefaultPrincipal() {
-        return defaultPrincipal;
+    public PrincipalInfo getDefaultPrincipal() {
+        return defaultPrincipalInfo;
     }
 
     /**
@@ -184,7 +184,7 @@
         infoFactory.addAttribute("realmName", String.class, true);
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
-        infoFactory.addAttribute("defaultPrincipal", Principal.class, true);
+        infoFactory.addAttribute("defaultPrincipal", PrincipalInfo.class, true);
         infoFactory.addAttribute("deploymentSupport", Properties.class, true);
         infoFactory.addAttribute("restrictPrincipalsToServer", boolean.class, true);
         infoFactory.addAttribute("wrapPrincipals", boolean.class, true);

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/util/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/util/ConfigurationUtil.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/util/ConfigurationUtil.java (original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/util/ConfigurationUtil.java Mon Nov 14 19:50:14 2005
@@ -38,7 +38,7 @@
 import org.apache.geronimo.security.deploy.DefaultDomainPrincipal;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deploy.DefaultRealmPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 
 
 /**
@@ -64,18 +64,19 @@
     /**
      * Create a Principal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a RealmPrincipal from a deployment description
      */
-    public static java.security.Principal generatePrincipal(final Principal principal) {
-        return generatePrincipal(principal.getClassName(), principal.getPrincipalName());
+    public static java.security.Principal generatePrincipal(final PrincipalInfo principalInfo, ClassLoader classLoader) {
+        return generatePrincipal(principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static java.security.Principal generatePrincipal(final String className, final String principalName) {
+    public static java.security.Principal generatePrincipal(final String className, final String principalName, final ClassLoader classLoader) {
         try {
             return (java.security.Principal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
-                    Class clazz = Class.forName(className);
+                    Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                     return (java.security.Principal) constructor.newInstance(new Object[]{principalName});
                 }
@@ -92,51 +93,54 @@
     /**
      * Create a RealmPrincipal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a RealmPrincipal from a deployment description
      */
-    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final Principal principal) {
-        return generateRealmPrincipal(realm, loginDomain, principal.getClassName(), principal.getPrincipalName());
+    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final PrincipalInfo principalInfo, ClassLoader classLoader) {
+        return generateRealmPrincipal(realm, loginDomain, principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final String className, final String principalName
-    )
+    public static RealmPrincipal generateRealmPrincipal(final String realm, final String loginDomain, final String className, final String principalName,
+                                                        ClassLoader classLoader)
     {
-        return new RealmPrincipal(realm, loginDomain, generatePrincipal(className, principalName));
+        return new RealmPrincipal(realm, loginDomain, generatePrincipal(className, principalName, classLoader));
     }
 
     /**
      * Create a DomainPrincipal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a RealmPrincipal from a deployment description
      */
-    public static DomainPrincipal generateDomainPrincipal(final String loginDomain, final Principal principal) {
-        return generateDomainPrincipal(loginDomain, principal.getClassName(), principal.getPrincipalName());
+    public static DomainPrincipal generateDomainPrincipal(final String loginDomain, final PrincipalInfo principalInfo, ClassLoader classLoader) {
+        return generateDomainPrincipal(loginDomain, principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static DomainPrincipal generateDomainPrincipal(final String loginDomain, final String className, final String principalName) {
-        return new DomainPrincipal(loginDomain, generatePrincipal(className, principalName));
+    public static DomainPrincipal generateDomainPrincipal(final String loginDomain, final String className, final String principalName, ClassLoader classLoader) {
+        return new DomainPrincipal(loginDomain, generatePrincipal(className, principalName, classLoader));
     }
 
     /**
      * Create a RealmPrincipal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a PrimaryRealmPrincipal from a deployment description
      */
-    public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(final String realm, final String domain, final Principal principal) throws DeploymentException {
-        return generatePrimaryRealmPrincipal(realm, domain, principal.getClassName(), principal.getPrincipalName());
+    public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(final String realm, final String domain, final PrincipalInfo principalInfo, ClassLoader classLoader) throws DeploymentException {
+        return generatePrimaryRealmPrincipal(realm, domain, principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(final String realm, final String domain, final String className, final String principalName
-    ) throws DeploymentException
+    public static PrimaryRealmPrincipal generatePrimaryRealmPrincipal(final String realm, final String domain, final String className, final String principalName,
+                                                                      final ClassLoader classLoader) throws DeploymentException
     {
         try {
             return (PrimaryRealmPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
                     java.security.Principal p = null;
-                    Class clazz = Class.forName(className);
+                    Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                     p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
 
@@ -151,21 +155,22 @@
     /**
      * Create a DomainPrincipal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a PrimaryDomainPrincipal from a deployment description
      */
-    public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(final String domain, final Principal principal) throws DeploymentException {
-        return generatePrimaryDomainPrincipal(domain, principal.getClassName(), principal.getPrincipalName());
+    public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(final String domain, final PrincipalInfo principalInfo, ClassLoader classLoader) throws DeploymentException {
+        return generatePrimaryDomainPrincipal(domain, principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(final String domain, final String className, final String principalName
-    ) throws DeploymentException
+    public static PrimaryDomainPrincipal generatePrimaryDomainPrincipal(final String domain, final String className, final String principalName,
+                                                                        final ClassLoader classLoader) throws DeploymentException
     {
         try {
             return (PrimaryDomainPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
                     java.security.Principal p = null;
-                    Class clazz = Class.forName(className);
+                    Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                     p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
 
@@ -180,19 +185,20 @@
     /**
      * Create a Principal from a deployment description.
      *
-     * @param principal the deployment description of the principal to be created.
+     * @param principalInfo the deployment description of the principal to be created.
+     * @param classLoader
      * @return a Principal from a deployment description
      */
-    public static PrimaryPrincipal generatePrimaryPrincipal(final Principal principal) throws DeploymentException {
-        return generatePrimaryPrincipal(principal.getClassName(), principal.getPrincipalName());
+    public static PrimaryPrincipal generatePrimaryPrincipal(final PrincipalInfo principalInfo, ClassLoader classLoader) throws DeploymentException {
+        return generatePrimaryPrincipal(principalInfo.getClassName(), principalInfo.getPrincipalName(), classLoader);
     }
 
-    public static PrimaryPrincipal generatePrimaryPrincipal(final String className, final String principalName) throws DeploymentException {
+    public static PrimaryPrincipal generatePrimaryPrincipal(final String className, final String principalName, final ClassLoader classLoader) throws DeploymentException {
         try {
             return (PrimaryPrincipal) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                 public Object run() throws Exception {
                     java.security.Principal p = null;
-                    Class clazz = Class.forName(className);
+                    Class clazz = classLoader.loadClass(className);
                     Constructor constructor = clazz.getDeclaredConstructor(new Class[]{String.class});
                     p = (java.security.Principal) constructor.newInstance(new Object[]{principalName});
 
@@ -208,9 +214,10 @@
      * Generate the default principal from the security config.
      *
      * @param defaultPrincipal
+     * @param classLoader
      * @return the default principal
      */
-    public static Subject generateDefaultSubject(DefaultPrincipal defaultPrincipal) throws DeploymentException {
+    public static Subject generateDefaultSubject(DefaultPrincipal defaultPrincipal, ClassLoader classLoader) throws DeploymentException {
         if (defaultPrincipal == null) {
             throw new GeronimoSecurityException("No DefaultPrincipal configuration supplied");
         }
@@ -220,15 +227,15 @@
 
         if (defaultPrincipal instanceof DefaultRealmPrincipal) {
             DefaultRealmPrincipal defaultRealmPrincipal = (DefaultRealmPrincipal) defaultPrincipal;
-            principal = generateRealmPrincipal(defaultRealmPrincipal.getRealm(), defaultRealmPrincipal.getDomain(), defaultRealmPrincipal.getPrincipal());
-            primaryPrincipal = generatePrimaryRealmPrincipal(defaultRealmPrincipal.getRealm(), defaultRealmPrincipal.getDomain(), defaultRealmPrincipal.getPrincipal());
+            principal = generateRealmPrincipal(defaultRealmPrincipal.getRealm(), defaultRealmPrincipal.getDomain(), defaultRealmPrincipal.getPrincipal(), classLoader);
+            primaryPrincipal = generatePrimaryRealmPrincipal(defaultRealmPrincipal.getRealm(), defaultRealmPrincipal.getDomain(), defaultRealmPrincipal.getPrincipal(), classLoader);
         } else if (defaultPrincipal instanceof DefaultDomainPrincipal) {
             DefaultDomainPrincipal defaultDomainPrincipal = (DefaultDomainPrincipal) defaultPrincipal;
-            principal = generateDomainPrincipal(defaultDomainPrincipal.getDomain(), defaultDomainPrincipal.getPrincipal());
-            primaryPrincipal = generatePrimaryDomainPrincipal(defaultDomainPrincipal.getDomain(), defaultDomainPrincipal.getPrincipal());
+            principal = generateDomainPrincipal(defaultDomainPrincipal.getDomain(), defaultDomainPrincipal.getPrincipal(), classLoader);
+            primaryPrincipal = generatePrimaryDomainPrincipal(defaultDomainPrincipal.getDomain(), defaultDomainPrincipal.getPrincipal(), classLoader);
         } else {
-            principal = generatePrincipal(defaultPrincipal.getPrincipal());
-            primaryPrincipal = generatePrimaryPrincipal(defaultPrincipal.getPrincipal());
+            principal = generatePrincipal(defaultPrincipal.getPrincipal(), classLoader);
+            primaryPrincipal = generatePrimaryPrincipal(defaultPrincipal.getPrincipal(), classLoader);
 
         }
         defaultSubject.getPrincipals().add(principal);

Modified: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon Nov 14 19:50:14 2005
@@ -379,7 +379,7 @@
             if (!gerWebApp.isSetSecurityRealmName()) {
                 throw new DeploymentException("You have supplied a security configuration for web app " + module.getName() + " but no security-realm-name to allow login");
             }
-            SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(gerWebApp.getSecurity());
+            SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(gerWebApp.getSecurity(), cl);
             earContext.setSecurityConfiguration(securityConfiguration);
         }
     }
@@ -468,7 +468,7 @@
                 ObjectName valveName = NameFactory.getComponentName(null, null, null, null, valveChain, ValveGBean.J2EE_TYPE, moduleJ2eeContext);
                 webModuleData.setReferencePattern("TomcatValveChain", valveName);
             }
-            
+
             if (tomcatWebApp.isSetCluster()) {
                 String cluster = tomcatWebApp.getCluster().trim();
                 ObjectName clusterName = NameFactory.getComponentName(null, null, null, null, cluster, CatalinaClusterGBean.J2EE_TYPE, moduleJ2eeContext);

Modified: geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java (original)
+++ geronimo/trunk/modules/tomcat/src/java/org/apache/geronimo/tomcat/GeronimoStandardContext.java Mon Nov 14 19:50:14 2005
@@ -127,7 +127,7 @@
                  */
                 DefaultPrincipal defaultPrincipal = securityHolder.getDefaultPrincipal();
                 if (defaultPrincipal != null) {
-                    defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal);
+                    defaultSubject = ConfigurationUtil.generateDefaultSubject(defaultPrincipal, ctx.getWebClassLoader());
                     ContextManager.registerSubject(defaultSubject);
                     SubjectId id = ContextManager.getSubjectId(defaultSubject);
                     defaultSubject.getPrincipals().add(new IdentificationPrincipal(id));
@@ -166,11 +166,11 @@
                 addValve(valve);
             }
         }
-        
+
         CatalinaCluster cluster = ctx.getCluster();
         if (cluster != null)
             this.setCluster(cluster);
-        
+
         pipelineInitialized = true;
         this.webServiceMap = ctx.getWebServices();
 
@@ -202,7 +202,7 @@
 
         super.stop();
     }
-    
+
     public void addChild(Container child) {
         Wrapper wrapper = (Wrapper) child;
 

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java (original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java Mon Nov 14 19:50:14 2005
@@ -40,7 +40,7 @@
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
@@ -258,7 +258,7 @@
         propertiesRealmGBean.setAttribute("realmName", "Geronimo");
         propertiesRealmGBean.setReferencePattern("LoginModuleConfiguration", testUseName);
         propertiesRealmGBean.setReferencePattern("LoginService", loginServiceName);
-        Principal.PrincipalEditor principalEditor = new Principal.PrincipalEditor();
+        PrincipalInfo.PrincipalEditor principalEditor = new PrincipalInfo.PrincipalEditor();
         principalEditor.setAsText("metro,org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal,false");
         propertiesRealmGBean.setAttribute("defaultPrincipal", principalEditor.getValue());
 
@@ -268,7 +268,7 @@
         propertiesRealmGBean2.setAttribute("realmName", REALM_NAME);
         propertiesRealmGBean2.setReferencePattern("LoginModuleConfiguration", testUseName);
         propertiesRealmGBean2.setReferencePattern("LoginService", loginServiceName);
-        Principal.PrincipalEditor principalEditor2 = new Principal.PrincipalEditor();
+        PrincipalInfo.PrincipalEditor principalEditor2 = new PrincipalInfo.PrincipalEditor();
         principalEditor2.setAsText("metro,org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal,false");
         propertiesRealmGBean2.setAttribute("defaultPrincipal", principalEditor2.getValue());
 

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java (original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/ContainerTest.java Mon Nov 14 19:50:14 2005
@@ -39,7 +39,7 @@
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.jaas.GeronimoLoginConfiguration;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
@@ -215,7 +215,7 @@
         propertiesRealmGBean.setAttribute("realmName", "Geronimo");
         propertiesRealmGBean.setReferencePattern("LoginModuleConfiguration", testUseName);
         propertiesRealmGBean.setReferencePattern("LoginService", loginServiceName);
-        Principal.PrincipalEditor principalEditor = new Principal.PrincipalEditor();
+        PrincipalInfo.PrincipalEditor principalEditor = new PrincipalInfo.PrincipalEditor();
         principalEditor.setAsText("metro=org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
         propertiesRealmGBean.setAttribute("defaultPrincipal", principalEditor.getValue());
 

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java?rev=344301&r1=344300&r2=344301&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java (original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/JACCSecurityTest.java Mon Nov 14 19:50:14 2005
@@ -33,7 +33,7 @@
 import javax.security.jacc.WebUserDataPermission;
 
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deploy.Principal;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
 import org.apache.geronimo.security.deploy.Role;
 import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.deployment.SecurityBuilder;
@@ -60,15 +60,15 @@
         securityConfig.setUseContextHandler(false);
 
         DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
-        Principal principal = new Principal("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal", "izumi", false);
-        defaultPrincipal.setPrincipal(principal);
+        PrincipalInfo principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal", "izumi", false);
+        defaultPrincipal.setPrincipal(principalInfo);
 
         securityConfig.setDefaultPrincipal(defaultPrincipal);
 
         Role role = new Role();
         role.setRoleName("content-administrator");
-        principal = new Principal("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal", "it", false);
-        role.getPrincipals().add(principal);
+        principalInfo = new PrincipalInfo("org.apache.geronimo.security.realm.providers.GeronimoGroupPrincipal", "it", false);
+        role.getPrincipals().add(principalInfo);
 
         securityConfig.getRoleMappings().put(role.getRoleName(), role);
 
@@ -179,9 +179,9 @@
         stop(appName);
     }
 
-    public static void buildPrincipalRoleMap(Security security, Map roleDesignates, Map principalRoleMap) {
+    public void buildPrincipalRoleMap(Security security, Map roleDesignates, Map principalRoleMap) {
         Map roleToPrincipalMap = new HashMap();
-        SecurityBuilder.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap);
+        SecurityBuilder.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, getClass().getClassLoader());
         invertMap(roleToPrincipalMap, principalRoleMap);
     }
 



Mime
View raw message