geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r418888 [5/7] - in /geronimo/branches/pluggable-jacc: ./ applications/console/console-standard/src/java/org/apache/geronimo/console/securitymanager/realm/ configs/ configs/activemq/ configs/client-deployer/src/plan/ configs/client/ configs/...
Date Tue, 04 Jul 2006 00:50:47 GMT
Modified: geronimo/branches/pluggable-jacc/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon Jul  3 17:50:41 2006
@@ -46,13 +46,12 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xbeans.GbeanType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
@@ -65,13 +64,13 @@
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.jetty.Host;
 import org.apache.geronimo.jetty.JettyDefaultServletHolder;
 import org.apache.geronimo.jetty.JettyFilterHolder;
 import org.apache.geronimo.jetty.JettyFilterMapping;
 import org.apache.geronimo.jetty.JettyServletHolder;
 import org.apache.geronimo.jetty.JettyWebAppContext;
 import org.apache.geronimo.jetty.NonAuthenticator;
-import org.apache.geronimo.jetty.Host;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
@@ -82,7 +81,6 @@
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.deployment.SecurityBuilder;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
@@ -147,8 +145,10 @@
             Collection defaultFilterMappings,
             Object pojoWebServiceTemplate,
             Collection webServiceBuilder,
+            Collection securityBuilders,
+            Collection serviceBuilders,
             Kernel kernel) throws GBeanNotFoundException {
-        super(kernel);
+        super(kernel, securityBuilders, serviceBuilders);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
@@ -205,7 +205,7 @@
             // Output the target path in the error to make it clearer to the user which webapp
             // has the problem.  The targetPath is used, as moduleFile may have an unhelpful
             // value such as C:\geronimo-1.1\var\temp\geronimo-deploymentUtil22826.tmpdir
-            throw new DeploymentException("Error parsing web.xml for "+ targetPath, xmle);
+            throw new DeploymentException("Error parsing web.xml for " + targetPath, xmle);
         }
         check(webApp);
 
@@ -225,7 +225,7 @@
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
         // Note: logic elsewhere depends on the default artifact ID being the file name less extension (ConfigIDExtractor)
         String warName = new File(moduleFile.getName()).getName();
-        if(warName.lastIndexOf('.') > -1) {
+        if (warName.lastIndexOf('.') > -1) {
             warName = warName.substring(0, warName.lastIndexOf('.'));
         }
         idBuilder.resolve(environment, warName, "war");
@@ -260,17 +260,17 @@
                     rawPlan = (XmlObject) plan;
                 } else {
                     if (plan != null) {
-                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL());
+                        rawPlan = XmlBeansUtil.parse(((File) plan).toURL(), getClass().getClassLoader());
                     } else {
                         URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-web.xml");
                         try {
-                            rawPlan = XmlBeansUtil.parse(path);
+                            rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                         } catch (FileNotFoundException e) {
                             path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-jetty.xml");
                             try {
-                                rawPlan = XmlBeansUtil.parse(path);
+                                rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
                             } catch (FileNotFoundException e1) {
-                                log.warn("Web application " +targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
+                                log.warn("Web application " + targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
                             }
                         }
                     }
@@ -284,14 +284,14 @@
                 XmlObject webPlan = new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
                         JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "jetty").convertToSpecificPlan(rawPlan);
                 jettyWebApp = (JettyWebAppType) webPlan.changeType(JettyWebAppType.type);
-                SchemaConversionUtils.validateDD(jettyWebApp);
+                XmlBeansUtil.validateDD(jettyWebApp);
             } else {
                 String defaultContextRoot = determineDefaultContextRoot(webApp, standAlone, moduleFile, targetPath);
                 jettyWebApp = createDefaultPlan(defaultContextRoot);
             }
             return jettyWebApp;
         } catch (XmlException e) {
-            throw new DeploymentException("xml problem for web app "+targetPath, e);
+            throw new DeploymentException("xml problem for web app " + targetPath, e);
         }
     }
 
@@ -312,13 +312,8 @@
                 !gerWebApp.isSetSecurityRealmName()) {
             throw new DeploymentException("web.xml for web app " + module.getName() + " includes security elements but Geronimo deployment plan is not provided or does not contain <security-realm-name> element necessary to configure security accordingly.");
         }
-        if (gerWebApp.isSetSecurity()) {
-            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(), cl);
-            earContext.setSecurityConfiguration(securityConfiguration);
-        }
+        boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
+        buildSubstitutionGroups(gerWebApp, hasSecurityRealmName, module, earContext);
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection repository) throws DeploymentException {
@@ -330,8 +325,8 @@
         WebAppType webApp = (WebAppType) webModule.getSpecDD();
         JettyWebAppType jettyWebApp = (JettyWebAppType) webModule.getVendorDD();
 
-        GbeanType[] gbeans = jettyWebApp.getGbeanArray();
-        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleName, moduleContext);
+//        GbeanType[] gbeans = jettyWebApp.getGbeanArray();
+//        ServiceConfigBuilder.addGBeans(gbeans, moduleClassLoader, moduleName, moduleContext);
 
         UserTransaction userTransaction = new OnlineUserTransaction();
         //this may add to the web classpath with enhanced classes.
@@ -474,7 +469,7 @@
 
             JspConfigType[] jspConfigArray = webApp.getJspConfigArray();
             if (jspConfigArray.length > 1) {
-                throw new DeploymentException("Web app "+ module.getName() +" cannot have more than one jsp-config element.  Currently has " + jspConfigArray.length +" jsp-config elements.");
+                throw new DeploymentException("Web app " + module.getName() + " cannot have more than one jsp-config element.  Currently has " + jspConfigArray.length + " jsp-config elements.");
             }
             Map tagLibMap = new HashMap();
             for (int i = 0; i < jspConfigArray.length; i++) {
@@ -488,7 +483,7 @@
 
             LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
             if (loginConfigArray.length > 1) {
-                throw new DeploymentException("Web app "+ module.getName() +" cannot have more than one login-config element.  Currently has " + loginConfigArray.length +" login-config elements.");
+                throw new DeploymentException("Web app " + module.getName() + " cannot have more than one login-config element.  Currently has " + loginConfigArray.length + " login-config elements.");
             }
             if (loginConfigArray.length == 1) {
                 LoginConfigType loginConfig = loginConfigArray[0];
@@ -537,7 +532,7 @@
                 String servletName = servletMappingType.getServletName().getStringValue().trim();
                 if (!knownServlets.contains(servletName)) {
                     throw new DeploymentException("Web app " + module.getName() +
-                            " contains a servlet mapping that refers to servlet '" + servletName + 
+                            " contains a servlet mapping that refers to servlet '" + servletName +
                             "' but no such servlet was found!");
                 }
                 String urlPattern = servletMappingType.getUrlPattern().getStringValue().trim();
@@ -730,7 +725,7 @@
                 webModuleData.setAttribute("checkedPermissions", checkedPermissions);
 
                 earContext.addSecurityContext(policyContextID, componentPermissions);
-                DefaultPrincipal defaultPrincipal = earContext.getSecurityConfiguration().getDefaultPrincipal();
+                DefaultPrincipal defaultPrincipal = ((SecurityConfiguration) earContext.getSecurityConfiguration()).getDefaultPrincipal();
                 webModuleData.setAttribute("defaultPrincipal", defaultPrincipal);
 
                 webModuleData.setReferencePattern("RoleDesignateSource", earContext.getJaccManagerName());
@@ -742,7 +737,7 @@
         } catch (DeploymentException de) {
             throw de;
         } catch (Exception e) {
-            throw new DeploymentException("Unable to initialize webapp GBean for "+module.getName(), e);
+            throw new DeploymentException("Unable to initialize webapp GBean for " + module.getName(), e);
         }
     }
 
@@ -860,7 +855,7 @@
             servletData.setAttribute("jspFile", servletType.getJspFile().getStringValue().trim());
             //TODO MAKE THIS CONFIGURABLE!!! Jetty uses the servlet mapping set up from the default-web.xml
             servletData.setAttribute("servletClass", "org.apache.jasper.servlet.JspServlet");
-	    initParams.put("development", "false");
+            initParams.put("development", "false");
         } else {
             throw new DeploymentException("Neither servlet class nor jsp file is set for " + servletName); // TODO identify web app in message
         }
@@ -933,6 +928,8 @@
         infoBuilder.addReference("DefaultFilterMappings", Object.class);
         infoBuilder.addReference("PojoWebServiceTemplate", Object.class, NameFactory.SERVLET_WEB_SERVICE_TEMPLATE);
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -946,6 +943,8 @@
                 "DefaultFilterMappings",
                 "PojoWebServiceTemplate",
                 "WebServiceBuilder",
+                "SecurityBuilders",
+                "ServiceBuilders",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/branches/pluggable-jacc/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty-builder/src/schema/geronimo-jetty-1.1.xsd Mon Jul  3 17:50:41 2006
@@ -20,15 +20,17 @@
     xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
     targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web/jetty-1.1"
     xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1"
-    xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"
     xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"
+    xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-1.1"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">
+    <!--xmlns:security="http://geronimo.apache.org/xml/ns/security-1.1"-->
 
     <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.1" schemaLocation="geronimo-naming-1.1.xsd"/>
-    <xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>
+    <!--<xs:import namespace="http://geronimo.apache.org/xml/ns/security-1.1" schemaLocation="geronimo-security-1.1.xsd"/>-->
+    <xs:import namespace="http://geronimo.apache.org/xml/ns/j2ee/application-1.1" schemaLocation="geronimo-application-1.1.xsd"/>
     <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.1" schemaLocation="geronimo-module-1.1.xsd"/>
 
     <xs:element name="web-app" type="web:web-appType"/>
@@ -52,10 +54,10 @@
 
             <xs:sequence minOccurs="0">
                 <xs:element name="security-realm-name" type="xs:string"/>
-                <xs:element ref="security:security" minOccurs="0"/>
+                <xs:element ref="app:security" minOccurs="0"/>
             </xs:sequence>
 
-            <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
+            <xs:element ref="sys:service" minOccurs="0" maxOccurs="unbounded"/>
 
         </xs:sequence>
     </xs:complexType>

Modified: geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Mon Jul  3 17:50:41 2006
@@ -29,6 +29,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+
 import javax.management.ObjectName;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
@@ -38,6 +39,7 @@
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
+import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.gbean.AbstractName;
@@ -73,16 +75,19 @@
 import org.apache.geronimo.kernel.config.NullConfigurationStore;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.repository.Repository;
-import org.apache.geronimo.kernel.repository.ArtifactManager;
-import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
+import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
+import org.apache.xmlbeans.impl.schema.SchemaTypeImpl;
 
 /**
  * @version $Rev:385232 $ $Date$
@@ -262,6 +267,9 @@
 
     protected void setUp() throws Exception {
         super.setUp();
+
+        ((SchemaTypeImpl)GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());
+
         cl = this.getClass().getClassLoader();
         kernel = KernelFactory.newInstance().createKernel("test");
         kernel.boot();
@@ -317,7 +325,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), Collections.EMPTY_LIST, new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), kernel);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), Collections.EMPTY_LIST, new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), kernel);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Mon Jul  3 17:50:41 2006
@@ -5,6 +5,8 @@
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
+import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
@@ -21,6 +23,7 @@
 import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
 
@@ -48,7 +51,7 @@
     private JettyModuleBuilder builder;
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), null);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), null);
     }
 
     public void testContents() throws Exception {
@@ -56,7 +59,7 @@
         assertTrue(resourcePlan != null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
-        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
     public void testMoveSecurity1() throws Exception {
@@ -64,7 +67,7 @@
         assertTrue(resourcePlan != null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
-        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
     public void testMoveSecurity2() throws Exception {
@@ -72,14 +75,14 @@
         assertTrue(resourcePlan != null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
-        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
     public void testMoveSecurity3() throws Exception {
         URL resourcePlan = classLoader.getResource("plans/plan1C.xml");
         assertTrue(resourcePlan != null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
-        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
 //        System.out.println(jettyWebApp.xmlText());
     }
 
@@ -88,7 +91,7 @@
         assertTrue(resourcePlan!= null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
-        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
+//        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
     }
 
     public void testOldFormatExploded() throws Exception {
@@ -117,7 +120,7 @@
         ref.setRefName("ref");
         ref.setResourceLink("target");
 
-        SchemaConversionUtils.validateDD(webApp);
+        XmlBeansUtil.validateDD(webApp);
         System.out.println(webApp.toString());
     }
 
@@ -197,12 +200,12 @@
     public void testConvertToJettySchema() throws Exception {
         URL resourcePlan = classLoader.getResource("plans/plan4.xml");
         assertTrue(resourcePlan != null);
-        XmlObject rawPlan = XmlBeansUtil.parse(resourcePlan);
+        XmlObject rawPlan = XmlBeansUtil.parse(resourcePlan, getClass().getClassLoader());
         XmlObject webPlan = new GenericToSpecificPlanConverter(GerJettyDocument.type.getDocumentElementName().getNamespaceURI(),
                 JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "jetty").convertToSpecificPlan(rawPlan);
         URL ConvertedPlan = classLoader.getResource("plans/plan4-converted.xml");
         assertTrue(ConvertedPlan != null);
-        XmlObject converted = XmlBeansUtil.parse(ConvertedPlan);
+        XmlObject converted = XmlBeansUtil.parse(ConvertedPlan, getClass().getClassLoader());
         XmlCursor c = converted.newCursor();
         SchemaConversionUtils.findNestedElement(c, JettyWebAppDocument.type.getDocumentElementName());
         c.toFirstChild();

Modified: geronimo/branches/pluggable-jacc/modules/jetty/project.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty/project.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty/project.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty/project.xml Mon Jul  3 17:50:41 2006
@@ -83,6 +83,26 @@
             <artifactId>geronimo-security-builder</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean</artifactId>
+            <version>${xmlbeans_version}</version>
+        </dependency>
+        <dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>${stax_api_version}</version>
+        </dependency>
 
         <dependency>
             <groupId>geronimo</groupId>

Modified: geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyDefaultServletHolder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyDefaultServletHolder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyDefaultServletHolder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyDefaultServletHolder.java Mon Jul  3 17:50:41 2006
@@ -26,7 +26,7 @@
 import org.mortbay.jetty.servlet.ServletHolder;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class JettyDefaultServletHolder extends JettyServletHolder {
 

Modified: geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java Mon Jul  3 17:50:41 2006
@@ -43,7 +43,7 @@
  * This is intended to hold the web service stack for an axis POJO web service.
  * It is starting life as a copy of JettyServletHolder.
  *
- * @version $Rev: 385886 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class JettyPOJOWebServiceHolder extends ServletHolder implements GBeanLifecycle {
     private WebServiceContainer webServiceContainer;

Modified: geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebApplicationHandler.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebApplicationHandler.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebApplicationHandler.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebApplicationHandler.java Mon Jul  3 17:50:41 2006
@@ -30,7 +30,7 @@
 import org.apache.geronimo.security.ContextManager;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class JettyWebApplicationHandler extends WebApplicationHandler {
 

Modified: geronimo/branches/pluggable-jacc/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/jetty/src/test/org/apache/geronimo/jetty/SecurityTest.java Mon Jul  3 17:50:41 2006
@@ -36,7 +36,7 @@
 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;
+import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 
 
@@ -182,7 +182,7 @@
     //copied from SecurityBuilder
     public void buildPrincipalRoleMap(Security security, Map roleDesignates, Map principalRoleMap) {
         Map roleToPrincipalMap = new HashMap();
-        SecurityBuilder.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, getClass().getClassLoader());
+        GeronimoSecurityBuilderImpl.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, getClass().getClassLoader());
         invertMap(roleToPrincipalMap, principalRoleMap);
     }
 

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java Mon Jul  3 17:50:41 2006
@@ -32,7 +32,7 @@
 import org.apache.geronimo.kernel.Jsr77Naming;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AbstractName implements Serializable {
     private static final long serialVersionUID = 3584199042821734754L;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractNameQuery.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractNameQuery.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractNameQuery.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractNameQuery.java Mon Jul  3 17:50:41 2006
@@ -33,7 +33,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AbstractNameQuery implements Serializable {
     private static final long serialVersionUID = 7444620122607155678L;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/ReferencePatterns.java Mon Jul  3 17:50:41 2006
@@ -24,7 +24,7 @@
 import java.util.Set;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class ReferencePatterns implements Serializable {
     private static final long serialVersionUID = 1888371271299507818L;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanDependency.java Mon Jul  3 17:50:41 2006
@@ -28,7 +28,7 @@
 import org.apache.geronimo.kernel.management.State;
 
 /**
- * @version $Rev: 386907 $ $Date$
+ * @version $Rev$ $Date$
  */
 public final class GBeanDependency {
 

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstanceState.java Mon Jul  3 17:50:41 2006
@@ -28,7 +28,7 @@
 import java.util.Set;
 
 /**
- * @version $Rev: 386907 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class GBeanInstanceState {
     private static final Log log = LogFactory.getLog(GBeanInstanceState.class);

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanReference.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanReference.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanReference.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanReference.java Mon Jul  3 17:50:41 2006
@@ -19,7 +19,7 @@
 import org.apache.geronimo.gbean.GReferenceInfo;
 
 /**
- * @version $Rev: 384141 $ $Date$
+ * @version $Rev$ $Date$
  */
 public interface GBeanReference {
     String getName();

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanSingleReference.java Mon Jul  3 17:50:41 2006
@@ -27,7 +27,7 @@
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 
 /**
- * @version $Rev: 384141 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class GBeanSingleReference extends AbstractGBeanReference {
     private static final Log log = LogFactory.getLog(GBeanSingleReference.class);

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ProxyCollection.java Mon Jul  3 17:50:41 2006
@@ -36,7 +36,7 @@
 import java.util.Set;
 
 /**
- * @version $Rev: 383682 $ $Date$
+ * @version $Rev$ $Date$
  */
 class ProxyCollection implements ReferenceCollection {
     private static final Log log = LogFactory.getLog(ProxyCollection.class);

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicLifecycleMonitor.java Mon Jul  3 17:50:41 2006
@@ -36,7 +36,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class BasicLifecycleMonitor implements LifecycleMonitor {
     private static final Log log = LogFactory.getLog(BasicLifecycleMonitor.class);

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicRegistry.java Mon Jul  3 17:50:41 2006
@@ -35,7 +35,7 @@
 import org.apache.geronimo.kernel.Kernel;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class BasicRegistry implements InstanceRegistry {
     private final Map objectNameRegistry = new HashMap();

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java Mon Jul  3 17:50:41 2006
@@ -42,7 +42,7 @@
 import java.util.Set;
 
 /**
- * @version $Rev: 385487 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ProxyMethodInterceptor implements MethodInterceptor {
     /**

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java Mon Jul  3 17:50:41 2006
@@ -25,7 +25,7 @@
  * A specialized ConfigurationManager that can change the set of GBeans
  * included in the configuration at runtime.
  *
- * @version $Rev: 384351 $ $Date$
+ * @version $Rev$ $Date$
  */
 public interface EditableConfigurationManager extends ConfigurationManager {
     /**

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyFactory.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyFactory.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyFactory.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/proxy/ProxyFactory.java Mon Jul  3 17:50:41 2006
@@ -23,7 +23,7 @@
 
 
 /**
- * @version $Rev: 383682 $ $Date$
+ * @version $Rev$ $Date$
  */
 public interface ProxyFactory {
     Object createProxy(AbstractName target);

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Artifact.java Mon Jul  3 17:50:41 2006
@@ -20,7 +20,7 @@
 import java.io.Serializable;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class Artifact implements Comparable, Serializable {
     private static final long serialVersionUID = -3459638899709893444L;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Environment.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Environment.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Environment.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/java/org/apache/geronimo/kernel/repository/Environment.java Mon Jul  3 17:50:41 2006
@@ -30,7 +30,7 @@
 /**
  * holds the data from the EnvironmentType xml while it is being resolved, transitively closed, etc.
  *
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class Environment implements Serializable {
     private static final long serialVersionUID = 7075760873629376317L;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java Mon Jul  3 17:50:41 2006
@@ -26,7 +26,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 384141 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class Speed {
     private static final Object[] NO_ARGS = new Object[0];

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java Mon Jul  3 17:50:41 2006
@@ -27,7 +27,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 383682 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class GBeanAttributeTest extends TestCase {
 

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java Mon Jul  3 17:50:41 2006
@@ -27,7 +27,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 384351 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class GBeanDependencyTest extends TestCase {
     private Kernel kernel;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java Mon Jul  3 17:50:41 2006
@@ -32,7 +32,7 @@
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ConfigTest extends TestCase {
     private Kernel kernel;

Modified: geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/classloader/UrlResourceFinderTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/classloader/UrlResourceFinderTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/classloader/UrlResourceFinderTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/kernel/src/test/org/apache/geronimo/kernel/classloader/UrlResourceFinderTest.java Mon Jul  3 17:50:41 2006
@@ -31,7 +31,7 @@
 import junit.framework.TestCase;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class UrlResourceFinderTest extends TestCase {
     private File jarFile;

Modified: geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java (original)
+++ geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/JCAConnectionFactory.java Mon Jul  3 17:50:41 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.management.geronimo;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface JCAConnectionFactory extends org.apache.geronimo.management.JCAConnectionFactory {
     JCAManagedConnectionFactory getManagedConnectionFactoryInstance();

Modified: geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java (original)
+++ geronimo/branches/pluggable-jacc/modules/management/src/java/org/apache/geronimo/management/geronimo/ResourceAdapter.java Mon Jul  3 17:50:41 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.management.geronimo;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface ResourceAdapter extends org.apache.geronimo.management.ResourceAdapter {
     JCAResource[] getJCAResourceImplementations();

Modified: geronimo/branches/pluggable-jacc/modules/naming-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/naming-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/naming-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/naming-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -36,7 +36,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
-                <version>${xmlbeansMavenPluginVersion}</version>
                 <executions>
                     <execution>
                         <goals>

Modified: geronimo/branches/pluggable-jacc/modules/naming-builder/project.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/naming-builder/project.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/naming-builder/project.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/naming-builder/project.xml Mon Jul  3 17:50:41 2006
@@ -16,7 +16,7 @@
     limitations under the License.
 -->
 
-<!-- $Rev: 385372 $ $Date$ -->
+<!-- $Rev$ $Date$ -->
 
 <project>
     <pomVersion>3</pomVersion>

Modified: geronimo/branches/pluggable-jacc/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java (original)
+++ geronimo/branches/pluggable-jacc/modules/naming/src/test/org/apache/geronimo/naming/java/ContextBuilderTest.java Mon Jul  3 17:50:41 2006
@@ -31,7 +31,7 @@
 import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 
 /**
- * @version $Rev: 385372 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ContextBuilderTest extends TestCase {
     private ComponentContextBuilder builder;

Modified: geronimo/branches/pluggable-jacc/modules/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/pom.xml Mon Jul  3 17:50:41 2006
@@ -41,6 +41,8 @@
             </activation>
             <modules>
                 <module>activation</module>
+                <module>activemq-gbean</module>
+                <module>activemq-gbean-management</module>
                 <module>activemq-embedded-rar</module>
                 <module>axis</module>
                 <module>axis-builder</module>

Modified: geronimo/branches/pluggable-jacc/modules/security-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/security-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -36,7 +36,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
-                <version>${xmlbeansMavenPluginVersion}</version>
                 <executions>
                     <execution>
                         <goals>
@@ -74,34 +73,28 @@
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-deployment</artifactId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
         </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-service-builder</artifactId>
         </dependency>
-
-        <!--needed only because security schema references j2ee 1.4 schema for description element -->
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-j2ee-schema</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-common</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-j2ee</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.geronimo.modules</groupId>
-            <artifactId>geronimo-kernel</artifactId>
-        </dependency>
+<!---->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-common</artifactId>-->
+        <!--</dependency>-->
+<!---->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-j2ee</artifactId>-->
+        <!--</dependency>-->
+<!---->
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-kernel</artifactId>-->
+        <!--</dependency>-->
 
         <!-- provided by kernel -->
         <dependency>

Modified: geronimo/branches/pluggable-jacc/modules/security-builder/project.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security-builder/project.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security-builder/project.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/security-builder/project.xml Mon Jul  3 17:50:41 2006
@@ -72,6 +72,15 @@
             <artifactId>geronimo-deployment</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
 
         <dependency>
             <groupId>geronimo</groupId>

Added: geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java?rev=418888&view=auto
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java (added)
+++ geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java Mon Jul  3 17:50:41 2006
@@ -0,0 +1,323 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.security.deployment;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.HashSet;
+
+import javax.security.auth.Subject;
+import javax.security.auth.x500.X500Principal;
+import javax.xml.namespace.QName;
+
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.security.deploy.Security;
+import org.apache.geronimo.security.deploy.Role;
+import org.apache.geronimo.security.deploy.RealmPrincipalInfo;
+import org.apache.geronimo.security.deploy.LoginDomainPrincipalInfo;
+import org.apache.geronimo.security.deploy.PrincipalInfo;
+import org.apache.geronimo.security.deploy.DistinguishedName;
+import org.apache.geronimo.security.deploy.DefaultPrincipal;
+import org.apache.geronimo.security.util.ConfigurationUtil;
+import org.apache.geronimo.security.jaas.NamedUsernamePasswordCredential;
+import org.apache.geronimo.security.jacc.ApplicationPrincipalRoleConfigurationManager;
+import org.apache.geronimo.security.jacc.ApplicationPolicyConfigurationManager;
+import org.apache.geronimo.xbeans.geronimo.security.GerSecurityType;
+import org.apache.geronimo.xbeans.geronimo.security.GerRoleMappingsType;
+import org.apache.geronimo.xbeans.geronimo.security.GerRoleType;
+import org.apache.geronimo.xbeans.geronimo.security.GerDistinguishedNameType;
+import org.apache.geronimo.xbeans.geronimo.security.GerDefaultPrincipalType;
+import org.apache.geronimo.xbeans.geronimo.security.GerNamedUsernamePasswordCredentialType;
+import org.apache.geronimo.xbeans.geronimo.security.GerRealmPrincipalType;
+import org.apache.geronimo.xbeans.geronimo.security.GerLoginDomainPrincipalType;
+import org.apache.geronimo.xbeans.geronimo.security.GerPrincipalType;
+import org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.deployment.SecurityBuilder;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class GeronimoSecurityBuilderImpl implements SecurityBuilder {
+    private static final QName SECURITY_QNAME = GerSecurityDocument.type.getDocumentElementName();
+    private static final QNameSet SECURITY_QNAME_SET = QNameSet.singleton(SECURITY_QNAME);
+
+
+    public void build(XmlObject container, DeploymentContext applicationContext, DeploymentContext moduleContext) throws DeploymentException {
+        EARContext earContext = (EARContext) applicationContext;
+        XmlObject[] items = container.selectChildren(SECURITY_QNAME_SET);
+        if (items.length > 1) {
+            throw new DeploymentException("Unexpected count of security elements in geronimo plan " + items.length + " qnameset: " + SECURITY_QNAME_SET);
+        }
+        if (items.length == 1) {
+            GerSecurityType securityType = (GerSecurityType) items[0].copy().changeType(GerSecurityType.type);
+            Security security = buildSecurityConfig(securityType);
+            ClassLoader classLoader = applicationContext.getClassLoader();
+            SecurityConfiguration securityConfiguration = buildSecurityConfiguration(security, classLoader);
+            earContext.setSecurityConfiguration(securityConfiguration);
+        }
+        //add the JACC gbean if there is a principal-role mapping and we are on the corect module
+        if (earContext.getSecurityConfiguration() != null && applicationContext == moduleContext) {
+            Naming naming = earContext.getNaming();
+            GBeanData roleMapperData = configureRoleMapper(naming, earContext.getModuleName(), earContext.getSecurityConfiguration());
+            try {
+                earContext.addGBean(roleMapperData);
+            } catch (GBeanAlreadyExistsException e) {
+                throw new DeploymentException("Role mapper gbean already present", e);
+            }
+            GBeanData jaccBeanData = configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
+            jaccBeanData.setReferencePattern("PrincipalRoleMapper", roleMapperData.getAbstractName());
+            try {
+                earContext.addGBean(jaccBeanData);
+            } catch (GBeanAlreadyExistsException e) {
+                throw new DeploymentException("JACC manager gbean already present", e);
+            }
+            earContext.setJaccManagerName(jaccBeanData.getAbstractName());
+        }
+    }
+
+    public String getNamespace() {
+        XmlBeansUtil.registerSubstitutionGroupElements(org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument.type.getDocumentElementName(), SECURITY_QNAME_SET);
+
+        return GerSecurityDocument.type.getDocumentElementName().getLocalPart();
+    }
+
+    private static SecurityConfiguration buildSecurityConfiguration(Security security, ClassLoader classLoader) {
+        Map roleDesignates = new HashMap();
+        Map principalRoleMap = new HashMap();
+        Map roleToPrincipalMap = new HashMap();
+        GeronimoSecurityBuilderImpl.buildRolePrincipalMap(security, roleDesignates, roleToPrincipalMap, classLoader);
+        GeronimoSecurityBuilderImpl.invertMap(roleToPrincipalMap, principalRoleMap);
+        return new SecurityConfiguration(principalRoleMap, roleDesignates, security.getDefaultPrincipal(), security.getDefaultRole(), security.isDoAsCurrentCaller(), security.isUseContextHandler());
+    }
+
+    private static Map invertMap(Map roleToPrincipalMap, Map principalRoleMapping) {
+        for (Iterator roles = roleToPrincipalMap.entrySet().iterator(); roles.hasNext();) {
+            Map.Entry entry = (Map.Entry) roles.next();
+            String role = (String) entry.getKey();
+            Set principals = (Set) entry.getValue();
+            for (Iterator iter = principals.iterator(); iter.hasNext();) {
+                java.security.Principal principal = (java.security.Principal) iter.next();
+
+                HashSet roleSet = (HashSet) principalRoleMapping.get(principal);
+                if (roleSet == null) {
+                    roleSet = new HashSet();
+                    principalRoleMapping.put(principal, roleSet);
+                }
+                roleSet.add(role);
+            }
+        }
+        return principalRoleMapping;
+    }
+
+    /**
+     * non-interface, used in some jetty/tomcat tests
+     *
+     * @param security
+     * @param roleDesignates
+     * @param roleToPrincipalMap
+     * @param classLoader
+     */
+    public static void buildRolePrincipalMap(Security security, Map roleDesignates, Map roleToPrincipalMap, ClassLoader classLoader) {
+
+        Iterator roleMappings = security.getRoleMappings().values().iterator();
+        while (roleMappings.hasNext()) {
+            Role role = (Role) roleMappings.next();
+
+            String roleName = role.getRoleName();
+            Subject roleDesignate = new Subject();
+            Set principalSet = new HashSet();
+
+            Iterator realmPrincipals = role.getRealmPrincipals().iterator();
+            while (realmPrincipals.hasNext()) {
+                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);
+            }
+
+            Iterator domainPrincipals = role.getLoginDomainPrincipals().iterator();
+            while (domainPrincipals.hasNext()) {
+                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);
+            }
+
+            Iterator principals = role.getPrincipals().iterator();
+            while (principals.hasNext()) {
+                PrincipalInfo plainPrincipalInfo = (PrincipalInfo) principals.next();
+                java.security.Principal principal = ConfigurationUtil.generatePrincipal(plainPrincipalInfo, classLoader);
+
+                principalSet.add(principal);
+                if (plainPrincipalInfo.isDesignatedRunAs()) roleDesignate.getPrincipals().add(principal);
+            }
+
+            for (Iterator names = role.getDistinguishedNames().iterator(); names.hasNext();) {
+                DistinguishedName dn = (DistinguishedName) names.next();
+
+                X500Principal x500Principal = ConfigurationUtil.generateX500Principal(dn.getName());
+
+                principalSet.add(x500Principal);
+                if (dn.isDesignatedRunAs()) roleDesignate.getPrincipals().add(x500Principal);
+            }
+
+            Set roleMapping = (Set) roleToPrincipalMap.get(roleName);
+            if (roleMapping == null) {
+                roleMapping = new HashSet();
+                roleToPrincipalMap.put(roleName, roleMapping);
+            }
+            roleMapping.addAll(principalSet);
+
+            if (roleDesignate.getPrincipals().size() > 0) {
+                roleDesignates.put(roleName, roleDesignate);
+            }
+        }
+    }
+
+    private Security buildSecurityConfig(GerSecurityType securityType) {
+        Security security;
+
+        if (securityType == null) {
+            return null;
+        }
+        security = new Security();
+
+        security.setDoAsCurrentCaller(securityType.getDoasCurrentCaller());
+        security.setUseContextHandler(securityType.getUseContextHandler());
+        if (securityType.isSetDefaultRole()) {
+            security.setDefaultRole(securityType.getDefaultRole().trim());
+        }
+
+        if (securityType.isSetRoleMappings()) {
+            GerRoleMappingsType roleMappingsType = securityType.getRoleMappings();
+            for (int i = 0; i < roleMappingsType.sizeOfRoleArray(); i++) {
+                GerRoleType roleType = roleMappingsType.getRoleArray(i);
+                Role role = new Role();
+
+                String roleName = roleType.getRoleName().trim();
+                role.setRoleName(roleName);
+
+                for (int j = 0; j < roleType.sizeOfRealmPrincipalArray(); j++) {
+                    role.getRealmPrincipals().add(GeronimoSecurityBuilderImpl.buildRealmPrincipal(roleType.getRealmPrincipalArray(j)));
+                }
+
+                for (int j = 0; j < roleType.sizeOfLoginDomainPrincipalArray(); j++) {
+                    role.getLoginDomainPrincipals().add(GeronimoSecurityBuilderImpl.buildDomainPrincipal(roleType.getLoginDomainPrincipalArray(j)));
+                }
+
+                for (int j = 0; j < roleType.sizeOfPrincipalArray(); j++) {
+                    role.getPrincipals().add(buildPrincipal(roleType.getPrincipalArray(j)));
+                }
+
+                for (int j = 0; j < roleType.sizeOfDistinguishedNameArray(); j++) {
+                    GerDistinguishedNameType dnType = roleType.getDistinguishedNameArray(j);
+
+                    role.getDistinguishedNames().add(new DistinguishedName(dnType.getName().trim(), dnType.getDesignatedRunAs()));
+                }
+
+                security.getRoleMappings().put(roleName, role);
+            }
+        }
+
+        security.setDefaultPrincipal(buildDefaultPrincipal(securityType.getDefaultPrincipal()));
+
+        return security;
+    }
+
+    //used from app client builder
+    public DefaultPrincipal buildDefaultPrincipal(XmlObject xmlObject) {
+        GerDefaultPrincipalType defaultPrincipalType = (GerDefaultPrincipalType) xmlObject;
+        DefaultPrincipal defaultPrincipal = new DefaultPrincipal();
+
+        defaultPrincipal.setPrincipal(buildPrincipal(defaultPrincipalType.getPrincipal()));
+        GerNamedUsernamePasswordCredentialType[] namedCredentials = defaultPrincipalType.getNamedUsernamePasswordCredentialArray();
+        if (namedCredentials.length > 0) {
+            Set defaultCredentialSet = new HashSet();
+            for (int i = 0; i < namedCredentials.length; i++) {
+                GerNamedUsernamePasswordCredentialType namedCredentialType = namedCredentials[i];
+                NamedUsernamePasswordCredential namedCredential = new NamedUsernamePasswordCredential(namedCredentialType.getUsername().trim(), namedCredentialType.getPassword().trim().toCharArray(), namedCredentialType.getName().trim());
+                defaultCredentialSet.add(namedCredential);
+            }
+            defaultPrincipal.setNamedUserPasswordCredentials(defaultCredentialSet);
+        }
+        return defaultPrincipal;
+    }
+
+    private static RealmPrincipalInfo buildRealmPrincipal(GerRealmPrincipalType realmPrincipalType) {
+        return new RealmPrincipalInfo(realmPrincipalType.getDomainName().trim(), realmPrincipalType.getRealmName().trim(), realmPrincipalType.getClass1().trim(), realmPrincipalType.getName().trim(), realmPrincipalType.isSetDesignatedRunAs());
+    }
+
+    private static LoginDomainPrincipalInfo buildDomainPrincipal(GerLoginDomainPrincipalType domainPrincipalType) {
+        return new LoginDomainPrincipalInfo(domainPrincipalType.getDomainName().trim(), domainPrincipalType.getClass1().trim(), domainPrincipalType.getName().trim(), domainPrincipalType.isSetDesignatedRunAs());
+    }
+
+    //used from TSSConfigEditor
+    public PrincipalInfo buildPrincipal(XmlObject xmlObject) {
+        GerPrincipalType principalType = (GerPrincipalType) xmlObject;
+        return new PrincipalInfo(principalType.getClass1().trim(), principalType.getName().trim(), principalType.isSetDesignatedRunAs());
+    }
+
+    public GBeanData configureRoleMapper(Naming naming, AbstractName moduleName, Object securityConfiguration) {
+        AbstractName roleMapperName = naming.createChildName(moduleName, "RoleMapper", "RoleMapper");
+        GBeanData roleMapperData = new GBeanData(roleMapperName, ApplicationPrincipalRoleConfigurationManager.GBEAN_INFO);
+        roleMapperData.setAttribute("principalRoleMap", ((SecurityConfiguration) securityConfiguration).getPrincipalRoleMap());
+        return roleMapperData;
+    }
+
+    public GBeanData configureApplicationPolicyManager(Naming naming, AbstractName moduleName, Map contextIDToPermissionsMap, Object securityConfiguration) {
+        AbstractName jaccBeanName = naming.createChildName(moduleName, NameFactory.JACC_MANAGER, NameFactory.JACC_MANAGER);
+        GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
+        jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
+        jaccBeanData.setAttribute("roleDesignates", ((SecurityConfiguration) securityConfiguration).getRoleDesignates());
+        return jaccBeanData;
+
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(GeronimoSecurityBuilderImpl.class, NameFactory.MODULE_BUILDER);
+
+        infoFactory.addInterface(SecurityBuilder.class);
+
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+
+}

Propchange: geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/GeronimoSecurityBuilderImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java Mon Jul  3 17:50:41 2006
@@ -26,7 +26,7 @@
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
-import org.apache.geronimo.deployment.service.GBeanBuilder;
+import org.apache.geronimo.deployment.service.SingleGBeanBuilder;
 import org.apache.geronimo.deployment.service.XmlReferenceBuilder;
 import org.apache.geronimo.deployment.xbeans.PatternType;
 import org.apache.geronimo.gbean.AbstractName;
@@ -98,7 +98,7 @@
                 if (abstractLoginModule instanceof GerLoginModuleRefType) {
                     GerLoginModuleRefType loginModuleRef = (GerLoginModuleRefType) abstractLoginModule;
                     PatternType patternType = loginModuleRef.getPattern();
-                    AbstractNameQuery loginModuleNameQuery = GBeanBuilder.buildAbstractNameQuery(patternType, USE_REFERENCE_INFO);
+                    AbstractNameQuery loginModuleNameQuery = SingleGBeanBuilder.buildAbstractNameQuery(patternType, USE_REFERENCE_INFO);
                     loginModuleReferencePatterns = new ReferencePatterns(loginModuleNameQuery);
                     name = (String) loginModuleNameQuery.getName().get("name");
                     if (name == null) {

Modified: geronimo/branches/pluggable-jacc/modules/security-builder/src/schema/geronimo-security-1.1.xsd
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security-builder/src/schema/geronimo-security-1.1.xsd?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security-builder/src/schema/geronimo-security-1.1.xsd (original)
+++ geronimo/branches/pluggable-jacc/modules/security-builder/src/schema/geronimo-security-1.1.xsd Mon Jul  3 17:50:41 2006
@@ -23,13 +23,15 @@
     xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
     xmlns:geronimo="http://geronimo.apache.org/xml/ns/security-1.1"
     targetNamespace="http://geronimo.apache.org/xml/ns/security-1.1"
+    xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-1.1"
     elementFormDefault="qualified"
     attributeFormDefault="unqualified"
     version="1.0">
     
     <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+    <xsd:import namespace="http://geronimo.apache.org/xml/ns/j2ee/application-1.1" schemaLocation="geronimo-application-1.1.xsd"/>
 
-    <xsd:element name="security" type="geronimo:securityType"/>
+    <xsd:element name="security" type="geronimo:securityType"  substitutionGroup="app:security"/>
     <xsd:element name="default-principal" type="geronimo:default-principalType"/>
 
     <xsd:complexType name="securityType">
@@ -41,6 +43,9 @@
                 appropriate access checks as outlined in the JACC spec.
             </xsd:documentation>
         </xsd:annotation>
+        <xsd:complexContent>
+            <xsd:extension base="app:abstract-securityType">
+
         <xsd:sequence>
             <xsd:element name="description" type="geronimo:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
             <xsd:element name="default-principal" type="geronimo:default-principalType"/>
@@ -73,6 +78,8 @@
                 </xsd:documentation>
             </xsd:annotation>
         </xsd:attribute>
+            </xsd:extension>
+        </xsd:complexContent>
     </xsd:complexType>
 
     <xsd:complexType name="descriptionType">

Modified: geronimo/branches/pluggable-jacc/modules/security/src/java/org/apache/geronimo/security/jaas/client/JaasLoginCoordinator.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/security/src/java/org/apache/geronimo/security/jaas/client/JaasLoginCoordinator.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/security/src/java/org/apache/geronimo/security/jaas/client/JaasLoginCoordinator.java (original)
+++ geronimo/branches/pluggable-jacc/modules/security/src/java/org/apache/geronimo/security/jaas/client/JaasLoginCoordinator.java Mon Jul  3 17:50:41 2006
@@ -48,7 +48,7 @@
  * case the client/server distinction is somewhat less important, and the
  * communication is optimized by avoiding network traffic.
  *
- * @version $Rev: 386763 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class JaasLoginCoordinator implements LoginModule {
     public final static String OPTION_HOST = "host";

Modified: geronimo/branches/pluggable-jacc/modules/service-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/service-builder/pom.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/service-builder/pom.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/service-builder/pom.xml Mon Jul  3 17:50:41 2006
@@ -35,7 +35,6 @@
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
                 <artifactId>xmlbeans-maven-plugin</artifactId>
-                <version>${xmlbeansMavenPluginVersion}</version>
                 <executions>
                     <execution>
                         <goals>
@@ -86,10 +85,12 @@
             <artifactId>geronimo-deploy-config</artifactId>
         </dependency>
 
+<!--
         <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-j2ee</artifactId>
         </dependency>
+-->
     </dependencies>
 </project>
 

Modified: geronimo/branches/pluggable-jacc/modules/service-builder/project.xml
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/service-builder/project.xml?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/service-builder/project.xml (original)
+++ geronimo/branches/pluggable-jacc/modules/service-builder/project.xml Mon Jul  3 17:50:41 2006
@@ -97,17 +97,17 @@
             <version>${geronimo_spec_j2ee_deployment_version}</version>
         </dependency>
 
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-j2ee</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>geronimo</groupId>-->
+            <!--<artifactId>geronimo-j2ee</artifactId>-->
+            <!--<version>${pom.currentVersion}</version>-->
+        <!--</dependency>-->
 
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-j2ee-schema</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>geronimo</groupId>-->
+            <!--<artifactId>geronimo-j2ee-schema</artifactId>-->
+            <!--<version>${pom.currentVersion}</version>-->
+        <!--</dependency>-->
 <!--
         <dependency>
             <groupId>cglib</groupId>

Modified: geronimo/branches/pluggable-jacc/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/branches/pluggable-jacc/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java?rev=418888&r1=418657&r2=418888&view=diff
==============================================================================
--- geronimo/branches/pluggable-jacc/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java (original)
+++ geronimo/branches/pluggable-jacc/modules/service-builder/src/java/org/apache/geronimo/deployment/service/EnvironmentBuilder.java Mon Jul  3 17:50:41 2006
@@ -45,7 +45,7 @@
 import org.apache.xmlbeans.XmlOptions;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class EnvironmentBuilder extends PropertyEditorSupport implements XmlAttributeBuilder {
     private final static QName QNAME = EnvironmentDocument.type.getDocumentElementName();



Mime
View raw message