geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r449135 - in /geronimo/server/trunk: configs/connector-deployer/src/plan/ configs/jetty-deployer/ configs/jetty-deployer/src/plan/ configs/openejb-deployer/src/plan/ configs/tomcat-deployer/ configs/tomcat-deployer/src/plan/ modules/geronim...
Date Sat, 23 Sep 2006 00:59:39 GMT
Author: djencks
Date: Fri Sep 22 17:59:37 2006
New Revision: 449135

URL: http://svn.apache.org/viewvc?view=rev&rev=449135
Log:
GERONIMO-2427.  Make ref builders accept either j2ee 1.4 or jee5 deployment descriptor xml

Added:
    geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java   (with props)
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java   (with props)
Modified:
    geronimo/server/trunk/configs/connector-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/jetty-deployer/pom.xml
    geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/tomcat-deployer/pom.xml
    geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
    geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java

Modified: geronimo/server/trunk/configs/connector-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/connector-deployer/src/plan/plan.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/connector-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/connector-deployer/src/plan/plan.xml Fri Sep 22 17:59:37 2006
@@ -42,7 +42,11 @@
         </xml-attribute>
     </gbean>
 
-    <gbean name="ResourceRefBuilder" class="org.apache.geronimo.connector.deployment.ResourceRefBuilder"/>
-    <gbean name="AdminObjectRefBuilder" class="org.apache.geronimo.connector.deployment.AdminObjectRefBuilder"/>
+    <gbean name="ResourceRefBuilder" class="org.apache.geronimo.connector.deployment.ResourceRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
+    </gbean>
+    <gbean name="AdminObjectRefBuilder" class="org.apache.geronimo.connector.deployment.AdminObjectRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
+    </gbean>
 
 </module>

Modified: geronimo/server/trunk/configs/jetty-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jetty-deployer/pom.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/jetty-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/jetty-deployer/pom.xml Fri Sep 22 17:59:37 2006
@@ -40,7 +40,15 @@
             <version>${pom.version}</version>
             <type>car</type>
         </dependency>
-        
+
+        <!--ResourceEnvironmentSetter-->
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>connector-deployer</artifactId>
+            <version>${pom.version}</version>
+            <type>car</type>
+        </dependency>
+
         <!-- similar thing not needed in tomcat !!! -->
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>

Modified: geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml Fri Sep 22 17:59:37 2006
@@ -54,6 +54,9 @@
         <reference name="ClusteringBuilders">
             <name>JettyClusteringBuilder</name>
         </reference>
+        <reference name="ResourceEnvironmentSetter">
+            <name>ResourceRefBuilder</name>
+        </reference>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Fri Sep 22 17:59:37 2006
@@ -46,6 +46,9 @@
         <reference name="NamingBuilders">
             <name>NamingBuilders</name>
         </reference>
+        <reference name="ResourceEnvironmentSetter">
+            <name>ResourceRefBuilder</name>
+        </reference>
         <reference name="ActivationSpecInfoLocator">
             <name>ConnectorBuilder</name>
         </reference>
@@ -72,6 +75,7 @@
     <gbean name="TSSAttributeBuilder" class="org.openejb.corba.security.config.tss.TSSConfigEditor"/>
 
     <gbean name="OpenEjbRemoteRefBuilder" class="org.openejb.deployment.OpenEjbRemoteRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>
@@ -86,6 +90,7 @@
     </gbean>
 
     <gbean name="OpenEjbClientRemoteRefBuilder" class="org.openejb.deployment.OpenEjbClientRemoteRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
         <attribute name="host">${PlanServerHostname}</attribute>
         <attribute name="port">${PlanOpenEJBPort}</attribute>
         <xml-attribute name="defaultEnvironment">
@@ -101,7 +106,9 @@
         </xml-attribute>
     </gbean>
 
-    <gbean name="OpenEjbLocalRefBuilder" class="org.openejb.deployment.OpenEjbLocalRefBuilder"/>
+    <gbean name="OpenEjbLocalRefBuilder" class="org.openejb.deployment.OpenEjbLocalRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
+    </gbean>
 
     <gbean name="CorbaRefBuilder" class="org.apache.geronimo.naming.deployment.CorbaRefBuilder">
         <reference name="CorbaGBeanNameSource">

Modified: geronimo/server/trunk/configs/tomcat-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/tomcat-deployer/pom.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/tomcat-deployer/pom.xml (original)
+++ geronimo/server/trunk/configs/tomcat-deployer/pom.xml Fri Sep 22 17:59:37 2006
@@ -41,6 +41,14 @@
             <type>car</type>
         </dependency>
         
+        <!--ResourceEnvironmentSetter-->
+        <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>connector-deployer</artifactId>
+            <version>${pom.version}</version>
+            <type>car</type>
+        </dependency>
+
         <!-- import classes -->
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>

Modified: geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml Fri Sep 22 17:59:37 2006
@@ -38,6 +38,9 @@
         <reference name="NamingBuilders">
             <name>NamingBuilders</name>
         </reference>
+        <reference name="ResourceEnvironmentSetter">
+            <name>ResourceRefBuilder</name>
+        </reference>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Fri Sep 22 17:59:37 2006
@@ -519,6 +519,7 @@
                 }
 
                 // add the app client static jndi provider
+                //TODO track resource ref shared and app managed security
                 AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                 try {

Modified: geronimo/server/trunk/modules/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java (original)
+++ geronimo/server/trunk/modules/geronimo-client/src/main/java/org/apache/geronimo/client/AppClientContainer.java Fri Sep 22 17:59:37 2006
@@ -105,6 +105,7 @@
 
     public void main(final String[] args) throws Exception {
         //TODO reorganize this so it makes more sense.  maybe use an interceptor stack.
+        //TODO track resource ref shared and app managed security
         Thread thread = Thread.currentThread();
 
         ClassLoader oldClassLoader = thread.getContextClassLoader();

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Fri Sep 22 17:59:37 2006
@@ -41,7 +41,6 @@
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceEnvRefDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceEnvRefType;
-import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
 import org.apache.geronimo.xbeans.j2ee.MessageDestinationRefType;
 import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.ResourceEnvRefType;
@@ -49,27 +48,28 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AdminObjectRefBuilder extends AbstractNamingBuilder {
-    private static final String J2EE_NAMESPACE = ConnectorDocument.type.getDocumentElementName().getNamespaceURI();
-    private static final QName ADMIN_OBJECT_REF_QNAME = new QName(J2EE_NAMESPACE, "resource-env-ref");
-    private static final QNameSet ADMIN_OBJECT_REF_QNAME_SET = QNameSet.singleton(ADMIN_OBJECT_REF_QNAME);
-    private static final QName MESSAGE_DESTINATION_REF_QNAME = new QName(J2EE_NAMESPACE, "message-destination-ref");
-//    private static final QNameSet ADMIN_OBJECT_REF_QNAME_SET = QNameSet.singleton(ADMIN_OBJECT_REF_QNAME);
+    private  final QNameSet adminOjbectRefQNameSet;
+    private final QNameSet messageDestinationQNameSet;
+    private final QNameSet messageDestinationRefQNameSet;
+
     private static final QName GER_ADMIN_OBJECT_REF_QNAME = GerResourceEnvRefDocument.type.getDocumentElementName();
     private static final QNameSet GER_ADMIN_OBJECT_REF_QNAME_SET = QNameSet.singleton(GER_ADMIN_OBJECT_REF_QNAME);
-    private static final QName MESSAGE_DESTINATION_REF = new QName(J2EE_NAMESPACE, "message-destination");
-    private static final QNameSet MESSAGE_DESTINATION_QNAME_SET = QNameSet.singleton(MESSAGE_DESTINATION_REF);
     private static final QName GER_MESSAGE_DESTINATION_QNAME = GerMessageDestinationDocument.type.getDocumentElementName();
     private static final QNameSet GER_MESSAGE_DESTINATION_QNAME_SET = QNameSet.singleton(GER_MESSAGE_DESTINATION_QNAME);
 
-
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
+    public AdminObjectRefBuilder(Environment defaultEnvironment, String[] eeNamespaces) {
+        super(defaultEnvironment);
+        adminOjbectRefQNameSet = buildQNameSet(eeNamespaces, "resource-env-ref");
+        messageDestinationQNameSet = buildQNameSet(eeNamespaces, "message-destination");
+        messageDestinationRefQNameSet = buildQNameSet(eeNamespaces, "message-destination-ref");
     }
 
+
     public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
-        XmlObject[] specDestinations = specDD.selectChildren(MESSAGE_DESTINATION_QNAME_SET);
+        XmlObject[] specDestinations = convert(specDD.selectChildren(messageDestinationQNameSet), J2EE_CONVERTER, MessageDestinationType.type);
         XmlObject[] gerDestinations = plan.selectChildren(GER_MESSAGE_DESTINATION_QNAME_SET);
             Map nameMap = new HashMap();
             for (int i = 0; i < gerDestinations.length; i++) {
@@ -78,7 +78,7 @@
                 nameMap.put(name, destination);
                 boolean found = false;
                 for (int j = 0; j < specDestinations.length; j++) {
-                    MessageDestinationType specDestination = (MessageDestinationType) specDestinations[j].copy().changeType(MessageDestinationType.type);
+                    MessageDestinationType specDestination = (MessageDestinationType) specDestinations[j];
                     if (specDestination.getMessageDestinationName().getStringValue().trim().equals(name)) {
                         found = true;
                         break;
@@ -93,7 +93,7 @@
 
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
-        XmlObject[] resourceEnvRefsUntyped = specDD.selectChildren(ADMIN_OBJECT_REF_QNAME_SET);
+        XmlObject[] resourceEnvRefsUntyped = convert(specDD.selectChildren(adminOjbectRefQNameSet), J2EE_CONVERTER, ResourceEnvRefType.type);
         ClassLoader cl = localConfiguration.getConfigurationClassLoader();
         XmlObject[] gerResourceEnvRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GER_ADMIN_OBJECT_REF_QNAME_SET);
         Map refMap = mapResourceEnvRefs(gerResourceEnvRefsUntyped);
@@ -118,10 +118,10 @@
         }
 
         //message-destination-refs
-        XmlObject[] messageDestinationRefsUntyped = specDD.selectChildren(MESSAGE_DESTINATION_REF_QNAME);
+        XmlObject[] messageDestinationRefsUntyped = convert(specDD.selectChildren(messageDestinationRefQNameSet), J2EE_CONVERTER, MessageDestinationRefType.type);
 
         for (int i = 0; i < messageDestinationRefsUntyped.length; i++) {
-            MessageDestinationRefType messageDestinationRef = (MessageDestinationRefType) messageDestinationRefsUntyped[i].copy().changeType(MessageDestinationRefType.type);
+            MessageDestinationRefType messageDestinationRef = (MessageDestinationRefType) messageDestinationRefsUntyped[i];
             String name = getStringValue(messageDestinationRef.getMessageDestinationRefName());
             String linkName = getStringValue(messageDestinationRef.getMessageDestinationLink());
             String type = getStringValue(messageDestinationRef.getMessageDestinationType());
@@ -235,7 +235,7 @@
     }
 
     public QNameSet getSpecQNameSet() {
-        return ADMIN_OBJECT_REF_QNAME_SET;
+        return adminOjbectRefQNameSet;
     }
 
     public QNameSet getPlanQNameSet() {
@@ -246,6 +246,10 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AdminObjectRefBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment", "eeNamespaces"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Fri Sep 22 17:59:37 2006
@@ -22,6 +22,8 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
+import java.util.HashSet;
 
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
@@ -31,40 +33,42 @@
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.naming.reference.ResourceReference;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefDocument;
 import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
-import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
 import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
 import org.apache.xmlbeans.QNameSet;
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
-public class ResourceRefBuilder extends AbstractNamingBuilder {
-    private static final String J2EE_NAMESPACE = ConnectorDocument.type.getDocumentElementName().getNamespaceURI();
-    private static final QName RESOURCE_REF_QNAME = new QName(J2EE_NAMESPACE, "resource-ref");
-    private static final QNameSet RESOURCE_REF_QNAME_SET = QNameSet.singleton(RESOURCE_REF_QNAME);
+public class ResourceRefBuilder extends AbstractNamingBuilder implements ResourceEnvironmentSetter {
     private static final QName GER_RESOURCE_REF_QNAME = GerResourceRefDocument.type.getDocumentElementName();
     private static final QNameSet GER_RESOURCE_REF_QNAME_SET = QNameSet.singleton(GER_RESOURCE_REF_QNAME);
 
+    private  final QNameSet resourceRefQNameSet;
+
     private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";
     private static final String JAVAX_MAIL_SESSION_CLASS = "javax.mail.Session";
 
+    public ResourceRefBuilder(Environment defaultEnvironment, String[] eeNamespaces) {
+        super(defaultEnvironment);
 
-    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
+        resourceRefQNameSet = buildQNameSet(eeNamespaces, "resource-ref");
     }
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
-        XmlObject[] resourceRefsUntyped = specDD.selectChildren(RESOURCE_REF_QNAME_SET);
+        XmlObject[] resourceRefsUntyped = convert(specDD.selectChildren(resourceRefQNameSet), J2EE_CONVERTER, ResourceRefType.type);
         XmlObject[] gerResourceRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GER_RESOURCE_REF_QNAME_SET);
         Map refMap = mapResourceRefs(gerResourceRefsUntyped);
         ClassLoader cl = localConfiguration.getConfigurationClassLoader();
@@ -139,6 +143,35 @@
 
     }
 
+    public void setResourceEnvironment(ResourceEnvironmentBuilder builder, XmlObject[] resourceRefs, GerResourceRefType[] gerResourceRefs) {
+        resourceRefs = convert(resourceRefs, J2EE_CONVERTER, ResourceRefType.type);
+        Map refMap = mapResourceRefs(gerResourceRefs);
+        Set unshareableResources = new HashSet();
+        Set applicationManagedSecurityResources = new HashSet();
+        for (int i = 0; i < resourceRefs.length; i++) {
+            ResourceRefType resourceRefType = (ResourceRefType) resourceRefs[i];
+
+            String type = resourceRefType.getResType().getStringValue().trim();
+
+            if (!URL.class.getName().equals(type)
+                    && !"javax.mail.Session".equals(type)
+                    && !JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
+
+                GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(resourceRefType.getResRefName().getStringValue());
+                AbstractNameQuery containerId = getResourceContainerId(getStringValue(resourceRefType.getResRefName()), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, null, gerResourceRef);
+
+                if ("Unshareable".equals(getStringValue(resourceRefType.getResSharingScope()))) {
+                    unshareableResources.add(containerId);
+                }
+                if ("Application".equals(getStringValue(resourceRefType.getResAuth()))) {
+                    applicationManagedSecurityResources.add(containerId);
+                }
+            }
+        }
+        builder.setUnshareableResources(unshareableResources);
+        builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
+    }
+
     private Map mapResourceRefs(XmlObject[] refs) {
         Map refMap = new HashMap();
         if (refs != null) {
@@ -166,7 +199,7 @@
     }
 
     public QNameSet getSpecQNameSet() {
-        return RESOURCE_REF_QNAME_SET;
+        return resourceRefQNameSet;
     }
 
     public QNameSet getPlanQNameSet() {
@@ -177,6 +210,10 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceRefBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment", "eeNamespaces"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java Fri Sep 22 17:59:37 2006
@@ -49,6 +49,8 @@
 import org.apache.geronimo.kernel.repository.ArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Version;
+import org.apache.geronimo.naming.deployment.AbstractNamingBuilder;
+import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
@@ -61,7 +63,7 @@
     private static final Naming naming = new Jsr77Naming();
     Configuration configuration;
     AbstractName baseName;
-    AdminObjectRefBuilder adminObjectRefBuilder = new AdminObjectRefBuilder();
+    AdminObjectRefBuilder adminObjectRefBuilder = new AdminObjectRefBuilder(null, new String[] {SchemaConversionUtils.J2EE_NAMESPACE});
     Module module;
 
     Map componentContext = new HashMap();

Added: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java?view=auto&rev=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java Fri Sep 22 17:59:37 2006
@@ -0,0 +1,104 @@
+/**
+ *
+ * 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.connector;
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.Statement;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.connector.outbound.ConnectionFactorySource;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class DatabaseInitializationGBean {
+
+
+    public DatabaseInitializationGBean(String testSQL, String path, ConnectionFactorySource cfSource, ClassLoader classLoader) throws Exception {
+
+        DataSource ds = (DataSource) cfSource.$getResource();
+        Connection c = ds.getConnection();
+        try {
+            Statement s = c.createStatement();
+            try {
+                try {
+                    s.execute(testSQL);
+                    //script does not need to be run
+                    return;
+                } catch (SQLException e) {
+                    //script needs to be run
+                }
+                URL sourceURL = classLoader.getResource(path);
+                InputStream ins = sourceURL.openStream();
+                BufferedReader r = new BufferedReader(new InputStreamReader(ins));
+                try {
+                    String line;
+                    StringBuffer buf = new StringBuffer();
+                    while ((line = r.readLine()) != null) {
+                        line = line.trim();
+                        if (!line.startsWith("--") && line.length() > 0) {
+                            buf.append(line).append(" ");
+                            if (line.endsWith(";")) {
+                                int size = buf.length();
+                                buf.delete(size - 2, size - 1);
+                                String sql = buf.toString();
+                                s.execute(sql);
+                                buf = new StringBuffer();
+                            }
+                        }
+                    }
+                } finally {
+                    r.close();
+                }
+            } finally {
+                s.close();
+            }
+        } finally {
+            c.close();
+        }
+
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(DatabaseInitializationGBean.class, "GBean");
+        infoBuilder.addAttribute("testSQL", String.class, true);
+        infoBuilder.addAttribute("path", String.class, true);
+        infoBuilder.addReference("DataSource", ConnectionFactorySource.class, NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
+        infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
+
+        infoBuilder.setConstructor(new String[]{"testSQL", "path", "DataSource", "classLoader"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Propchange: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-connector/src/main/java/org/apache/geronimo/connector/DatabaseInitializationGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java Fri Sep 22 17:59:37 2006
@@ -35,7 +35,7 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class NamingBuilderCollection implements NamingBuilder {
 
@@ -72,15 +72,26 @@
 
     private void addBuilder(Object builder) {
         QNameSet builderSpecQNames = ((NamingBuilder)builder).getSpecQNameSet();
+        QNameSet builderPlanQNames = ((NamingBuilder)builder).getPlanQNameSet();
+        if (builderSpecQNames == null) {
+            throw new IllegalStateException("Builder " + builder + " is missing spec qnames");
+        }
+        if (builderPlanQNames == null) {
+            throw new IllegalStateException("Builder " + builder + " is missing plan qnames");
+        }
         if (!specQNames.isDisjoint(builderSpecQNames)) {
             throw new IllegalArgumentException("Duplicate builderSpecQNames in builder set: " + builderSpecQNames);
         }
-        specQNames = specQNames.union(builderSpecQNames);
-        QNameSet builderPlanQNames = ((NamingBuilder)builder).getPlanQNameSet();
         if (!planQNames.isDisjoint(builderPlanQNames)) {
             throw new IllegalArgumentException("Duplicate builderPlanQNames in builder set: " + builderPlanQNames);
         }
-        planQNames = planQNames.union(builderPlanQNames);
+        try {
+            specQNames = specQNames.union(builderSpecQNames);
+            planQNames = planQNames.union(builderPlanQNames);
+        } catch (NullPointerException e) {
+            throw (IllegalArgumentException)new IllegalArgumentException("could not merge qnamesets for builder " + builder).initCause(e);
+
+        }
         //really?
         XmlBeansUtil.registerSubstitutionGroupElements(basePlanElementName, builderPlanQNames);
     }

Modified: geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Fri Sep 22 17:59:37 2006
@@ -81,6 +81,7 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
@@ -149,8 +150,9 @@
             Collection securityBuilders,
             Collection serviceBuilders,
             NamingBuilder namingBuilders,
+            ResourceEnvironmentSetter resourceEnvironmentSetter,
             Kernel kernel) throws GBeanNotFoundException {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders);
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
@@ -365,7 +367,7 @@
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
-            ENCConfigBuilder.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
+            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
 
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 
@@ -1015,6 +1017,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -1032,6 +1035,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Fri Sep 22 17:59:37 2006
@@ -208,7 +208,7 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        ((SchemaTypeImpl)GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());
+        ((SchemaTypeImpl) GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());
 
         cl = this.getClass().getClassLoader();
         kernel = KernelFactory.newInstance().createKernel("test");
@@ -266,19 +266,20 @@
         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),
-                         null,
-                         Collections.singleton(new GeronimoSecurityBuilderImpl()),
-                         Collections.singleton(new GBeanBuilder(null, null)),
-                         new NamingBuilderCollection(null, null), 
-                         kernel);
+                new Integer(1800),
+                Collections.EMPTY_LIST,
+                new AbstractNameQuery(containerName),
+                defaultServlets,
+                defaultFilters,
+                defaultFilterMappings,
+                pojoWebServiceTemplate,
+                Collections.singleton(webServiceBuilder),
+                null,
+                Collections.singleton(new GeronimoSecurityBuilderImpl()),
+                Collections.singleton(new GBeanBuilder(null, null)),
+                new NamingBuilderCollection(null, null),
+                new MockResourceEnvironmentSetter(),
+                kernel);
     }
 
     protected void tearDown() throws Exception {

Added: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java?view=auto&rev=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java (added)
+++ geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java Fri Sep 22 17:59:37 2006
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.jetty.deployment;
+
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class MockResourceEnvironmentSetter implements ResourceEnvironmentSetter {
+    public void setResourceEnvironment(ResourceEnvironmentBuilder builder, XmlObject[] resourceRefs, GerResourceRefType[] gerResourceRefs) {
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Fri Sep 22 17:59:37 2006
@@ -7,7 +7,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.jar.JarFile;
-  
+
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
@@ -41,7 +41,7 @@
 /**
  */
 public class PlanParsingTest extends TestSupport {
-    
+
     private ClassLoader classLoader = this.getClass().getClassLoader();
 
     private Naming naming = new Jsr77Naming();
@@ -55,19 +55,20 @@
 
     public PlanParsingTest() throws Exception {
         builder = new JettyModuleBuilder(defaultEnvironment,
-            new Integer(1800),
-            null,
-            jettyContainerObjectName,
-            new HashSet(),
-            new HashSet(),
-            new HashSet(),
-            pojoWebServiceTemplate,
-            Collections.singleton(webServiceBuilder),
-            null,
-            Collections.singleton(new GeronimoSecurityBuilderImpl()),
-            Collections.singleton(new GBeanBuilder(null, null)),
-            new NamingBuilderCollection(null, null), 
-            null);
+                new Integer(1800),
+                null,
+                jettyContainerObjectName,
+                new HashSet(),
+                new HashSet(),
+                new HashSet(),
+                pojoWebServiceTemplate,
+                Collections.singleton(webServiceBuilder),
+                null,
+                Collections.singleton(new GeronimoSecurityBuilderImpl()),
+                Collections.singleton(new GBeanBuilder(null, null)),
+                new NamingBuilderCollection(null, null),
+                new MockResourceEnvironmentSetter(),
+                null);
     }
 
     public void testContents() throws Exception {
@@ -104,7 +105,7 @@
 
     public void testOldFormat() throws Exception {
         URL resourcePlan = classLoader.getResource("plans/plan2.xml");
-        assertTrue(resourcePlan!= null);
+        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);
@@ -149,7 +150,8 @@
         configId.setType("car");
     }
 
-    /** This test has 2 purposes: one the obvious one explicitly tested,
+    /**
+     * This test has 2 purposes: one the obvious one explicitly tested,
      * the other that passing a JettyWebAppType XmlObject in works.  This latter
      * models a web-app element inside an ear plan.
      *

Modified: geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java Fri Sep 22 17:59:37 2006
@@ -256,7 +256,8 @@
          */
         //TODO use run-as as nextCaller if present
         ContextManager.setCallers(defaultPrincipal.getSubject(), defaultPrincipal.getSubject());
-        ContextManager.setNextCaller(defaultPrincipal.getSubject());
+        //??????? next line does nothing!
+//        ContextManager.setNextCaller(defaultPrincipal.getSubject());
         return defaultPrincipal;
     }
 

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java (original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java Fri Sep 22 17:59:37 2006
@@ -121,7 +121,7 @@
             }
         } catch (Exception e) {
             // this can not happen... all classes must implement equals, hashCode and toString
-            throw new AssertionError(e);
+            throw new AssertionError(new Exception("Could not install invoker for proxyType " + proxyType + " for target " + abstractName, e));
         }
 
         return invokers;

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Fri Sep 22 17:59:37 2006
@@ -17,28 +17,37 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.util.Set;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+
+import javax.xml.namespace.QName;
 
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
-import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.geronimo.schema.NamespaceElementConverter;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.QNameSet;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public abstract class AbstractNamingBuilder implements NamingBuilder {
+    protected static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    protected static final String JEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
+    protected static final NamespaceElementConverter J2EE_CONVERTER = new NamespaceElementConverter(J2EE_NAMESPACE);
 
     private final Environment defaultEnvironment;
 
@@ -63,6 +72,40 @@
     public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
     }
 
+    protected static QNameSet buildQNameSet(String[] eeNamespaces, String localPart) {
+        Set qnames = new HashSet(eeNamespaces.length);
+        for (int i = 0; i < eeNamespaces.length; i++) {
+            String namespace = eeNamespaces[i];
+            qnames.add(new QName(namespace, localPart));
+        }
+        //xmlbeans 2.0 has a bug so forArray doesn't work.  Don't know if it's fixed in later xmlbeans versions
+        //return QNameSet.forArray(qnames);
+        return QNameSet.forSets(null, Collections.EMPTY_SET, Collections.EMPTY_SET, qnames);
+    }
+
+    protected XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) {
+        //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
+        XmlObject[] converted = new XmlObject[xmlObjects.length];
+        for (int i = 0; i < xmlObjects.length; i++) {
+            XmlObject xmlObject = xmlObjects[i];
+            if (xmlObject.schemaType() != type) {
+                xmlObject = xmlObject.copy();
+                XmlCursor start =xmlObject.newCursor();
+                XmlCursor end = xmlObject.newCursor();
+
+                try {
+                    converter.convertElement(start, end);
+                } finally {
+                    start.dispose();
+                    end.dispose();
+                }
+                converted[i] = xmlObject.changeType(type);
+            } else {
+                converted[i] = xmlObject;
+            }
+        }
+        return converted;
+    }
     protected static String getStringValue(org.apache.geronimo.xbeans.j2ee.String string) {
         if (string == null) {
             return null;

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java Fri Sep 22 17:59:37 2006
@@ -39,9 +39,6 @@
  */
 public class ENCConfigBuilder {
 
-    private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";
-
-
     public static AbstractNameQuery getGBeanQuery(String j2eeType, GerGbeanLocatorType gerGbeanLocator) {
         AbstractNameQuery abstractNameQuery;
         if (gerGbeanLocator.isSetGbeanLink()) {
@@ -56,70 +53,6 @@
         }
         //TODO check that the query is satisfied.
         return abstractNameQuery;
-    }
-
-    private static AbstractNameQuery getResourceContainerId(String name, String type, URI moduleURI, GerResourceRefType gerResourceRef) {
-        AbstractNameQuery containerId;
-        String module = moduleURI == null ? null : moduleURI.toString();
-        if (gerResourceRef == null) {
-            containerId = buildAbstractNameQuery(null, module, name, type, NameFactory.RESOURCE_ADAPTER_MODULE);
-        } else if (gerResourceRef.isSetResourceLink()) {
-            containerId = buildAbstractNameQuery(null, module, gerResourceRef.getResourceLink().trim(), type, NameFactory.RESOURCE_ADAPTER_MODULE);
-        } else {
-            //construct name from components
-            GerPatternType patternType = gerResourceRef.getPattern();
-            containerId = buildAbstractNameQuery(patternType, type, NameFactory.RESOURCE_ADAPTER_MODULE, null);
-        }
-        return containerId;
-    }
-
-    private static String getStringValue(org.apache.geronimo.xbeans.j2ee.String string) {
-        if (string == null) {
-            return null;
-        }
-        String s = string.getStringValue();
-        return s == null ? null : s.trim();
-    }
-
-    public static void setResourceEnvironment(ResourceEnvironmentBuilder builder, ResourceRefType[] resourceRefs, GerResourceRefType[] gerResourceRefs) {
-        Map refMap = mapResourceRefs(gerResourceRefs);
-        Set unshareableResources = new HashSet();
-        Set applicationManagedSecurityResources = new HashSet();
-        for (int i = 0; i < resourceRefs.length; i++) {
-            ResourceRefType resourceRefType = resourceRefs[i];
-
-            String type = resourceRefType.getResType().getStringValue().trim();
-
-            if (!URL.class.getName().equals(type)
-                    && !"javax.mail.Session".equals(type)
-                    && !JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
-
-                GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(resourceRefType.getResRefName().getStringValue());
-                AbstractNameQuery containerId = getResourceContainerId(getStringValue(resourceRefType.getResRefName()), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, null, gerResourceRef);
-
-                if ("Unshareable".equals(getStringValue(resourceRefType.getResSharingScope()))) {
-                    unshareableResources.add(containerId);
-                }
-                if ("Application".equals(getStringValue(resourceRefType.getResAuth()))) {
-                    applicationManagedSecurityResources.add(containerId);
-                }
-            }
-        }
-        builder.setUnshareableResources(unshareableResources);
-        builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
-    }
-
-
-
-    private static Map mapResourceRefs(GerResourceRefType[] refs) {
-        Map refMap = new HashMap();
-        if (refs != null) {
-            for (int i = 0; i < refs.length; i++) {
-                GerResourceRefType ref = refs[i];
-                refMap.put(ref.getRefName().trim(), ref);
-            }
-        }
-        return refMap;
     }
 
     public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type, String moduleType, Set interfaceTypes) {

Added: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java?view=auto&rev=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java (added)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java Fri Sep 22 17:59:37 2006
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.naming.deployment;
+
+import org.apache.xmlbeans.XmlObject;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface ResourceEnvironmentSetter {
+
+    void setResourceEnvironment(ResourceEnvironmentBuilder builder, XmlObject[] resourceRefs, GerResourceRefType[] gerResourceRefs);
+
+}

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Fri Sep 22 17:59:37 2006
@@ -61,6 +61,7 @@
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
@@ -102,8 +103,11 @@
             AbstractNameQuery tomcatContainerName,
             Collection webServiceBuilder,
             Collection securityBuilders,
-            Collection serviceBuilders, NamingBuilder namingBuilders, Kernel kernel) {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders);
+            Collection serviceBuilders,
+            NamingBuilder namingBuilders,
+            ResourceEnvironmentSetter resourceEnvironmentSetter,
+            Kernel kernel) {
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter);
         this.defaultEnvironment = defaultEnvironment;
 
         this.tomcatContainerName = tomcatContainerName;
@@ -294,7 +298,7 @@
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
-            ENCConfigBuilder.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
+            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
 
             webModuleData.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
             webModuleData.setReferencePattern("TrackedConnectionAssociator", earContext.getConnectionTrackerName());
@@ -453,6 +457,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -463,6 +468,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Added: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java?view=auto&rev=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java (added)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java Fri Sep 22 17:59:37 2006
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.tomcat.deployment;
+
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class MockResourceEnvironmentSetter implements ResourceEnvironmentSetter {
+    public void setResourceEnvironment(ResourceEnvironmentBuilder builder, XmlObject[] resourceRefs, GerResourceRefType[] gerResourceRefs) {
+    }
+}

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java Fri Sep 22 17:59:37 2006
@@ -23,6 +23,9 @@
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
 import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.xmlbeans.XmlObject;
 
 /**
  */
@@ -38,7 +41,7 @@
     private TomcatModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), new MockResourceEnvironmentSetter(), null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Fri Sep 22 17:59:37 2006
@@ -316,7 +316,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName), Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName), Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), new MockResourceEnvironmentSetter(), null);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java?view=diff&rev=449135&r1=449134&r2=449135
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-web-builder/src/main/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java Fri Sep 22 17:59:37 2006
@@ -77,6 +77,7 @@
 import org.apache.geronimo.xbeans.j2ee.WebAppType;
 import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -94,6 +95,7 @@
     protected final Kernel kernel;
     protected final NamespaceDrivenBuilderCollection securityBuilders;
     protected final NamespaceDrivenBuilderCollection serviceBuilders;
+    protected final ResourceEnvironmentSetter resourceEnvironmentSetter;
 
     protected final NamingBuilder namingBuilders;
 
@@ -107,12 +109,12 @@
      */
     private static final URI RELATIVE_MODULE_BASE_URI = URI.create("../");
 
-    protected AbstractWebModuleBuilder(Kernel kernel, Collection securityBuilders, Collection serviceBuilders, NamingBuilder namingBuilders) {
+    protected AbstractWebModuleBuilder(Kernel kernel, Collection securityBuilders, Collection serviceBuilders, NamingBuilder namingBuilders, ResourceEnvironmentSetter resourceEnvironmentSetter) {
         this.kernel = kernel;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders);
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
         this.namingBuilders = namingBuilders;
-
+        this.resourceEnvironmentSetter = resourceEnvironmentSetter;
     }
 
     static {



Mime
View raw message