geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r374211 - /geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
Date Thu, 02 Feb 2006 00:19:55 GMT
Author: djencks
Date: Wed Feb  1 16:19:53 2006
New Revision: 374211

URL: http://svn.apache.org/viewcvs?rev=374211&view=rev
Log:
GERONIMO-1563 step one missed file

Modified:
    geronimo/trunk/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java

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=374211&r1=374210&r2=374211&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
Wed Feb  1 16:19:53 2006
@@ -22,6 +22,7 @@
 import java.util.Map;
 import java.util.Set;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
 
@@ -35,6 +36,7 @@
 import org.apache.geronimo.security.deploy.Security;
 import org.apache.geronimo.security.jaas.NamedUsernamePasswordCredential;
 import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
+import org.apache.geronimo.security.jacc.ApplicationPrincipalRoleConfigurationManager;
 import org.apache.geronimo.security.util.ConfigurationUtil;
 import org.apache.geronimo.xbeans.geronimo.security.GerDefaultPrincipalType;
 import org.apache.geronimo.xbeans.geronimo.security.GerDistinguishedNameType;
@@ -45,6 +47,10 @@
 import org.apache.geronimo.xbeans.geronimo.security.GerRoleMappingsType;
 import org.apache.geronimo.xbeans.geronimo.security.GerRoleType;
 import org.apache.geronimo.xbeans.geronimo.security.GerSecurityType;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.common.DeploymentException;
 
 
 /**
@@ -225,12 +231,23 @@
         return new PrincipalInfo(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
     }
 
-    public static GBeanData configureApplicationPolicyManager(ObjectName name, Map contextIDToPermissionsMap,
SecurityConfiguration securityConfiguration) {
+    public static void configureApplicationPolicyManager(ObjectName name, Map contextIDToPermissionsMap,
SecurityConfiguration securityConfiguration, J2eeContext appJ2eeContext, DeploymentContext
deploymentContext) throws DeploymentException {
+        ObjectName roleMapperName = null;
+        try {
+            roleMapperName = NameFactory.getComponentName(null, null, null, null, "RoleMapper",
"RoleMapper", appJ2eeContext);
+        } catch (MalformedObjectNameException e) {
+            throw new DeploymentException("Could not construct mapper object name", e);
+        }
+        GBeanData roleMapperData = new GBeanData(roleMapperName, ApplicationPrincipalRoleConfigurationManager.GBEAN_INFO);
+        roleMapperData.setAttribute("principalRoleMap", securityConfiguration.getPrincipalRoleMap());
+        deploymentContext.addGBean(roleMapperData);
+
         GBeanData jaccBeanData = new GBeanData(name, ApplicationPolicyConfigurationManager.GBEAN_INFO);
         jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
-        jaccBeanData.setAttribute("principalRoleMap", securityConfiguration.getPrincipalRoleMap());
         jaccBeanData.setAttribute("roleDesignates", securityConfiguration.getRoleDesignates());
-        return jaccBeanData;
+        jaccBeanData.setReferencePattern("PrincipalRoleMapper", roleMapperName);
+        deploymentContext.addGBean(jaccBeanData);
+
     }
 
 }



Mime
View raw message