geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r442387 [1/5] - in /geronimo/server/trunk: configs/axis-deployer/src/plan/ configs/client-deployer/src/plan/ configs/j2ee-deployer/src/plan/ configs/jetty-deployer/src/plan/ configs/openejb-deployer/src/plan/ configs/tomcat-deployer/src/pla...
Date Mon, 11 Sep 2006 23:51:36 GMT
Author: djencks
Date: Mon Sep 11 16:51:32 2006
New Revision: 442387

URL: http://svn.apache.org/viewvc?view=rev&rev=442387
Log:
GERONIMO-2383  Refactor naming builder to a set of registered builders

Added:
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ActivationSpecInfoLocator.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/CorbaGBeanNameSource.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/HandlerInfoInfo.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java   (with props)
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/CorbaRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/GBeanRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/PersistenceContextRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UnavailableRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/UserTransactionRefBuilder.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/connector/
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/connector/deployment/
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java   (with props)
    geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/reference/PersistenceContextReference.java   (with props)
Removed:
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EJBReferenceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ResourceReferenceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableEJBReferenceBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/UnavailableServiceReferenceBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
    geronimo/server/trunk/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/ComponentContextBuilder.java
    geronimo/server/trunk/modules/geronimo-naming/src/test/java/org/apache/geronimo/naming/java/ContextBuilderTest.java
Modified:
    geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.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/src/plan/plan.xml
    geronimo/server/trunk/configs/unavailable-ejb-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/unavailable-webservices-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/server/trunk/modules/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.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/JettyWebAppContext.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/schema/geronimo-naming-1.2.xsd
    geronimo/server/trunk/modules/geronimo-service-builder/src/main/java/org/apache/geronimo/deployment/xmlbeans/XmlBeansUtil.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/axis-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -19,4 +19,21 @@
 
     <gbean name="WebServiceBuilder" class="org.apache.geronimo.axis.builder.AxisBuilder"/>
 
+    <gbean name="AxisServiceRefBuilder" class="org.apache.geronimo.axis.builder.AxisServiceRefBuilder">
+        <xml-attribute name="defaultEnvironment">
+            <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>geronimo-axis</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
+        <reference name="AxisBuilder">
+            <name>WebServiceBuilder</name>
+        </reference>
+    </gbean>
+
 </module>

Modified: geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/client-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -27,28 +27,35 @@
         <reference name="ServiceBuilders">
             <name>GBeanBuilder</name>
         </reference>
-        <references name="EJBReferenceBuilder">
+        <references name="NamingBuilders">
             <pattern>
-                <name>ClientEJBReferenceBuilder</name>
+                <name>GBeanRefBuilder</name>
             </pattern>
             <pattern>
-                <name>UnavailableClientEJBReferenceBuilder</name>
+                <name>PersistenceContextRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>ResourceRefBuilder</name>
             </pattern>
-        </references>
-        <reference name="ConnectorModuleBuilder">
-            <name>ClientConnectorBuilder</name>
-        </reference>
-        <reference name="ResourceReferenceBuilder">
-            <name>ClientConnectorBuilder</name>
-        </reference>
-        <references name="ServiceReferenceBuilder">
             <pattern>
-                <name>WebServiceBuilder</name>
+                <name>AdminObjectRefBuilder</name>
             </pattern>
             <pattern>
-                <name>UnavailableWebServiceBuilder</name>
+                <name>EnvironmentEntryBuilder</name>
+            </pattern>
+            <pattern>
+                <name>AxisServiceRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>OpenEjbClientRemoteRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>CorbaRefBuilder</name>
             </pattern>
         </references>
+        <reference name="ConnectorModuleBuilder">
+            <name>ClientConnectorBuilder</name>
+        </reference>
         <xml-attribute name="defaultServerEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -57,25 +57,6 @@
                 <name>UnavailableAppClientBuilder</name>
             </pattern>
         </references>
-        <reference name="ResourceReferenceBuilder">
-            <name>ConnectorBuilder</name>
-        </reference>
-        <references name="ServiceReferenceBuilder">
-            <pattern>
-                <name>WebServiceBuilder</name>
-            </pattern>
-            <pattern>
-                <name>UnavailableWebServiceBuilder</name>
-            </pattern>
-        </references>
-        <references name="EJBReferenceBuilder">
-            <pattern>
-                <name>ServerEJBReferenceBuilder</name>
-            </pattern>
-            <pattern>
-                <name>UnavailableServerEJBReferenceBuilder</name>
-            </pattern>
-        </references>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>
@@ -135,6 +116,44 @@
         <attribute name="policyProvider">org.apache.geronimo.security.jacc.GeronimoPolicy</attribute>
     </gbean>
 
+    <gbean name="NamingBuilders" class="org.apache.geronimo.j2ee.deployment.NamingBuilderCollectionGBean">
+        <attribute name="baseElementQNameNamespaceURI">http://geronimo.apache.org/xml/ns/naming-1.2</attribute>
+        <attribute name="baseElementQNameLocalPart">abstract-naming-entry</attribute>
+        <references name="NamingBuilders">
+            <pattern>
+                <name>GBeanRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>PersistenceContextRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>ResourceRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>AdminObjectRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>EnvironmentEntryBuilder</name>
+            </pattern>
+            <pattern>
+                <name>AxisServiceRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>OpenEjbRemoteRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>OpenEjbLocalRefBuilder</name>
+            </pattern>
+            <pattern>
+                <name>CorbaRefBuilder</name>
+            </pattern>
+        </references>
+    </gbean>
 
+    <gbean name="GBeanRefBuilder" class="org.apache.geronimo.naming.deployment.GBeanRefBuilder"/>
+    <gbean name="PersistenceContextRefBuilder" class="org.apache.geronimo.naming.deployment.PersistenceContextRefBuilder"/>
+    <gbean name="ResourceRefBuilder" class="org.apache.geronimo.connector.deployment.ResourceRefBuilder"/>
+    <gbean name="AdminObjectRefBuilder" class="org.apache.geronimo.connector.deployment.AdminObjectRefBuilder"/>
+    <gbean name="EnvironmentEntryBuilder" class="org.apache.geronimo.naming.deployment.EnvironmentEntryBuilder"/>
 
 </module>

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=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/jetty-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -48,6 +48,9 @@
                 <name>UnavailableWebServiceBuilder</name>
             </pattern>
         </references>
+        <reference name="NamingBuilders">
+            <name>NamingBuilders</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=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -43,6 +43,12 @@
                 <name>UnavailableWebServiceBuilder</name>
             </pattern>
         </references>
+        <reference name="NamingBuilders">
+            <name>NamingBuilders</name>
+        </reference>
+        <reference name="ActivationSpecInfoLocator">
+            <name>ConnectorBuilder</name>
+        </reference>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>
@@ -65,12 +71,50 @@
     <gbean name="CSSAttributeBuilder" class="org.openejb.corba.security.config.css.CSSConfigEditor"/>
     <gbean name="TSSAttributeBuilder" class="org.openejb.corba.security.config.tss.TSSConfigEditor"/>
 
-    <gbean name="ClientEJBReferenceBuilder" class="org.openejb.deployment.RemoteEjbReferenceBuilder">
+    <gbean name="OpenEjbRemoteRefBuilder" class="org.openejb.deployment.OpenEjbRemoteRefBuilder">
+        <xml-attribute name="defaultEnvironment">
+            <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+                <dependencies>
+                    <dependency>
+                        <groupId>org.openejb</groupId>
+                        <artifactId>openejb-core</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
+    </gbean>
+
+    <gbean name="OpenEjbClientRemoteRefBuilder" class="org.openejb.deployment.OpenEjbClientRemoteRefBuilder">
         <attribute name="host">${PlanServerHostname}</attribute>
         <attribute name="port">${PlanOpenEJBPort}</attribute>
+        <xml-attribute name="defaultEnvironment">
+            <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
+                <dependencies>
+                    <dependency>
+                        <groupId>org.openejb</groupId>
+                        <artifactId>openejb-core</artifactId>
+                        <type>jar</type>
+                    </dependency>
+                </dependencies>
+            </environment>
+        </xml-attribute>
     </gbean>
 
-    <gbean name="ServerEJBReferenceBuilder" class="org.openejb.deployment.OpenEjbReferenceBuilder"/>
+    <gbean name="OpenEjbLocalRefBuilder" class="org.openejb.deployment.OpenEjbLocalRefBuilder"/>
+
+    <gbean name="CorbaRefBuilder" class="org.apache.geronimo.naming.deployment.CorbaRefBuilder">
+        <reference name="CorbaGBeanNameSource">
+            <name>EarBuilder</name>
+        </reference>
+    </gbean>
+    <gbean name="ClientCorbaRefBuilder" class="org.apache.geronimo.naming.deployment.CorbaRefBuilder">
+        <reference name="CorbaGBeanNameSource">
+            <name>AppClientBuilder</name>
+        </reference>
+    </gbean>
+
+
     <gbean name="WebServiceEJBLinkTemplate" class="org.openejb.server.axis.WSContainerGBean"/>
 
 </module>

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=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/tomcat-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -35,6 +35,9 @@
                 <name>UnavailableWebServiceBuilder</name>
             </pattern>
         </references>
+        <reference name="NamingBuilders">
+            <name>NamingBuilders</name>
+        </reference>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/configs/unavailable-ejb-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/unavailable-ejb-deployer/src/plan/plan.xml?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/unavailable-ejb-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/unavailable-ejb-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -21,8 +21,9 @@
 
     <gbean name="UnavailableEJBBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableModuleBuilder" />
 
-    <gbean name="UnavailableClientEJBReferenceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableEJBReferenceBuilder" />
+    <!-- TODO include new-style unavaliable naming builders -->
+    <!--<gbean name="UnavailableClientEJBReferenceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableEJBReferenceBuilder" />-->
 
-    <gbean name="UnavailableServerEJBReferenceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableEJBReferenceBuilder" />
+    <!--<gbean name="UnavailableServerEJBReferenceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableEJBReferenceBuilder" />-->
 
 </module>

Modified: geronimo/server/trunk/configs/unavailable-webservices-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/unavailable-webservices-deployer/src/plan/plan.xml?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/configs/unavailable-webservices-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/unavailable-webservices-deployer/src/plan/plan.xml Mon Sep 11 16:51:32 2006
@@ -21,6 +21,5 @@
 
     <gbean name="UnavailableWebServiceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableWebServiceBuilder" />
 
-    <gbean name="UnavailableServiceReferenceBuilder" class="org.apache.geronimo.j2ee.deployment.UnavailableServiceReferenceBuilder" />
-
+    <!--TODO need an unavailable naming builder -->
 </module>

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisBuilder.java Mon Sep 11 16:51:32 2006
@@ -57,13 +57,12 @@
 import org.apache.geronimo.axis.server.POJOProvider;
 import org.apache.geronimo.axis.server.ServiceInfo;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.HandlerInfoInfo;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPortCompletionType;
 import org.apache.geronimo.xbeans.geronimo.naming.GerPortType;
@@ -77,7 +76,7 @@
 /**
  * @version $Rev$ $Date$
  */
-public class AxisBuilder implements ServiceReferenceBuilder, WebServiceBuilder {
+public class AxisBuilder implements WebServiceBuilder {
 //    private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new Class[]{Map.class, Map.class};
 
     private static final SOAPConstants SOAP_VERSION = SOAPConstants.SOAP11_CONSTANTS;
@@ -145,7 +144,7 @@
 
 
     //ServicereferenceBuilder
-    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) throws DeploymentException {
+    public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, Module module, ClassLoader classLoader) throws DeploymentException {
         GerServiceRefType gerServiceRefType = (GerServiceRefType) serviceRefType;
         JarFile moduleFile = module.getModuleFile();
         SchemaInfoBuilder schemaInfoBuilder = null;
@@ -156,10 +155,10 @@
             mapping = WSDescriptorParser.readJaxrpcMapping(moduleFile, jaxrpcMappingURI);
         }
 
-        return createService(serviceInterface, schemaInfoBuilder, mapping, serviceQName, SOAP_VERSION, handlerInfos, gerServiceRefType, deploymentContext, module, classLoader);
+        return createService(serviceInterface, schemaInfoBuilder, mapping, serviceQName, SOAP_VERSION, handlerInfos, gerServiceRefType, module, classLoader);
     }
 
-    public Object createService(Class serviceInterface, SchemaInfoBuilder schemaInfoBuilder, JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos, GerServiceRefType serviceRefType, DeploymentContext context, Module module, ClassLoader classloader) throws DeploymentException {
+    public Object createService(Class serviceInterface, SchemaInfoBuilder schemaInfoBuilder, JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants soapVersion, List handlerInfos, GerServiceRefType serviceRefType, Module module, ClassLoader classloader) throws DeploymentException {
         Map seiPortNameToFactoryMap = new HashMap();
         Map seiClassNameToFactoryMap = new HashMap();
         if (schemaInfoBuilder != null) {
@@ -520,7 +519,6 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addInterface(ServiceReferenceBuilder.class);
         infoBuilder.addInterface(WebServiceBuilder.class);
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Added: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,223 @@
+/**
+ *
+ * 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.axis.builder;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.HandlerInfoInfo;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.ClassLoading;
+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.xbeans.geronimo.naming.GerServiceRefDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
+import org.apache.geronimo.xbeans.j2ee.ParamValueType;
+import org.apache.geronimo.xbeans.j2ee.PortComponentRefType;
+import org.apache.geronimo.xbeans.j2ee.ServiceRefHandlerType;
+import org.apache.geronimo.xbeans.j2ee.ServiceRefType;
+import org.apache.geronimo.xbeans.j2ee.XsdQNameType;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class AxisServiceRefBuilder extends AbstractNamingBuilder {
+    private static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    private static final QName SERVICE_REF_QNAME = new QName(J2EE_NAMESPACE, "service-ref");
+    private static final QNameSet SERVICE_REF_QNAME_SET = QNameSet.singleton(SERVICE_REF_QNAME);
+    private static final QName GER_SERVICE_REF_QNAME = GerServiceRefDocument.type.getDocumentElementName();
+    private static final QNameSet GER_SERVICE_REF_QNAME_SET = QNameSet.singleton(GER_SERVICE_REF_QNAME);
+
+    private final AxisBuilder axisBuilder;
+
+    public AxisServiceRefBuilder(Environment defaultEnvironment, AxisBuilder axisBuilder) {
+        super(defaultEnvironment);
+        this.axisBuilder = axisBuilder;
+    }
+
+    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
+         return getServiceRefs(specDD).length > 0;
+    }
+    
+    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+        XmlObject[] serviceRefsUntyped = getServiceRefs(specDD);
+        XmlObject[] gerServiceRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GER_SERVICE_REF_QNAME_SET);
+        Map serviceRefMap = mapServiceRefs(gerServiceRefsUntyped);
+        ClassLoader cl = localConfiguration.getConfigurationClassLoader();
+
+        for (int i = 0; i < serviceRefsUntyped.length; i++) {
+            ServiceRefType serviceRef = (ServiceRefType) serviceRefsUntyped[i];
+            String name = getStringValue(serviceRef.getServiceRefName());
+            GerServiceRefType serviceRefType = (GerServiceRefType) serviceRefMap.get(name);
+//            Map credentialsNameMap = (Map) serviceRefCredentialsNameMap.get(name);
+            String serviceInterfaceName = getStringValue(serviceRef.getServiceInterface());
+            assureInterface(serviceInterfaceName, "javax.xml.rpc.Service", "[Web]Service", cl);
+            Class serviceInterface;
+            try {
+                serviceInterface = cl.loadClass(serviceInterfaceName);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("Could not load service interface class: " + serviceInterfaceName, e);
+            }
+            URI wsdlURI = null;
+            if (serviceRef.isSetWsdlFile()) {
+                try {
+                    wsdlURI = new URI(serviceRef.getWsdlFile().getStringValue().trim());
+                } catch (URISyntaxException e) {
+                    throw new DeploymentException("could not construct wsdl uri from " + serviceRef.getWsdlFile().getStringValue(), e);
+                }
+            }
+            URI jaxrpcMappingURI = null;
+            if (serviceRef.isSetJaxrpcMappingFile()) {
+                try {
+                    jaxrpcMappingURI = new URI(getStringValue(serviceRef.getJaxrpcMappingFile()));
+                } catch (URISyntaxException e) {
+                    throw new DeploymentException("Could not construct jaxrpc mapping uri from " + serviceRef.getJaxrpcMappingFile(), e);
+                }
+            }
+            QName serviceQName = null;
+            if (serviceRef.isSetServiceQname()) {
+                serviceQName = serviceRef.getServiceQname().getQNameValue();
+            }
+            Map portComponentRefMap = new HashMap();
+            PortComponentRefType[] portComponentRefs = serviceRef.getPortComponentRefArray();
+            if (portComponentRefs != null) {
+                for (int j = 0; j < portComponentRefs.length; j++) {
+                    PortComponentRefType portComponentRef = portComponentRefs[j];
+                    String portComponentLink = getStringValue(portComponentRef.getPortComponentLink());
+                    String serviceEndpointInterfaceType = getStringValue(portComponentRef.getServiceEndpointInterface());
+                    assureInterface(serviceEndpointInterfaceType, "java.rmi.Remote", "ServiceEndpoint", cl);
+                    Class serviceEndpointClass;
+                    try {
+                        serviceEndpointClass = cl.loadClass(serviceEndpointInterfaceType);
+                    } catch (ClassNotFoundException e) {
+                        throw new DeploymentException("could not load service endpoint class " + serviceEndpointInterfaceType, e);
+                    }
+                    portComponentRefMap.put(serviceEndpointClass, portComponentLink);
+                }
+            }
+            ServiceRefHandlerType[] handlers = serviceRef.getHandlerArray();
+            List handlerInfos = buildHandlerInfoList(handlers, cl);
+
+//we could get a Reference or the actual serializable Service back.
+            Object ref = axisBuilder.createService(serviceInterface, wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlerInfos, serviceRefType, module, cl);
+            componentContext.put(ENV + name, ref);
+        }
+
+    }
+
+    private XmlObject[] getServiceRefs(XmlObject specDD) {
+        XmlObject[] serviceRefsUntyped = specDD.selectChildren(SERVICE_REF_QNAME_SET);
+        return serviceRefsUntyped;
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return SERVICE_REF_QNAME_SET;
+    }
+
+    public QNameSet getPlanQNameSet() {
+        return GER_SERVICE_REF_QNAME_SET;
+    }
+
+
+    private static List buildHandlerInfoList(ServiceRefHandlerType[] handlers, ClassLoader classLoader) throws DeploymentException {
+        List handlerInfos = new ArrayList();
+        for (int i = 0; i < handlers.length; i++) {
+            ServiceRefHandlerType handler = handlers[i];
+            org.apache.geronimo.xbeans.j2ee.String[] portNameArray = handler.getPortNameArray();
+            List portNames = new ArrayList();
+            for (int j = 0; j < portNameArray.length; j++) {
+                portNames.add(portNameArray[j].getStringValue().trim());
+
+            }
+//            Set portNames = new HashSet(Arrays.asList(portNameArray));
+            String handlerClassName = handler.getHandlerClass().getStringValue().trim();
+            Class handlerClass;
+            try {
+                handlerClass = ClassLoading.loadClass(handlerClassName, classLoader);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("Could not load handler class", e);
+            }
+            Map config = new HashMap();
+            ParamValueType[] paramValues = handler.getInitParamArray();
+            for (int j = 0; j < paramValues.length; j++) {
+                ParamValueType paramValue = paramValues[j];
+                String paramName = paramValue.getParamName().getStringValue().trim();
+                String paramStringValue = paramValue.getParamValue().getStringValue().trim();
+                config.put(paramName, paramStringValue);
+            }
+            XsdQNameType[] soapHeaderQNames = handler.getSoapHeaderArray();
+            QName[] headerQNames = new QName[soapHeaderQNames.length];
+            for (int j = 0; j < soapHeaderQNames.length; j++) {
+                XsdQNameType soapHeaderQName = soapHeaderQNames[j];
+                headerQNames[j] = soapHeaderQName.getQNameValue();
+            }
+            Set soapRoles = new HashSet();
+            for (int j = 0; j < handler.getSoapRoleArray().length; j++) {
+                String soapRole = handler.getSoapRoleArray(j).getStringValue().trim();
+                soapRoles.add(soapRole);
+            }
+            HandlerInfoInfo handlerInfoInfo = new HandlerInfoInfo(new HashSet(portNames), handlerClass, config, headerQNames, soapRoles);
+            handlerInfos.add(handlerInfoInfo);
+        }
+        return handlerInfos;
+    }
+
+
+    private static Map mapServiceRefs(XmlObject[] refs) {
+        Map refMap = new HashMap();
+        if (refs != null) {
+            for (int i = 0; i < refs.length; i++) {
+                GerServiceRefType ref = (GerServiceRefType) refs[i].copy().changeType(GerServiceRefType.type);
+                String serviceRefName = ref.getServiceRefName().trim();
+                refMap.put(serviceRefName, ref);
+            }
+        }
+        return refMap;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisServiceRefBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+        infoBuilder.addReference("AxisBuilder", AxisBuilder.class, NameFactory.MODULE_BUILDER);
+
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment", "AxisBuilder"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/test/java/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Mon Sep 11 16:51:32 2006
@@ -176,7 +176,7 @@
         JavaWsdlMappingType mapping = buildLightweightMappingType();
         QName serviceQName = new QName(NAMESPACE, "MockService");
         AxisBuilder builder = new AxisBuilder();
-        Object reference = builder.createService(MockService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module, isolatedCl);
+        Object reference = builder.createService(MockService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(reference);
         assertTrue(reference instanceof AxisServiceReference);
         AxisServiceReference claReference = (AxisServiceReference) reference;
@@ -198,7 +198,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://www.Monson-Haefel.com/jwsbook/BookQuote", "BookQuoteService");
         AxisBuilder builder = new AxisBuilder();
-        Object reference = builder.createService(BookQuoteService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module, isolatedCl);
+        Object reference = builder.createService(BookQuoteService.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(reference);
         assertTrue(reference instanceof AxisServiceReference);
         AxisServiceReference claReference = (AxisServiceReference) reference;
@@ -220,7 +220,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab", "interopLab");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(InteropLab.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, context, module, isolatedCl);
+        Object proxy = builder.createService(InteropLab.class, schemaInfoBuilder, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, handlerInfos, gerServiceRefType, module, isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof InteropLab);
         InteropTestPortType interopTestPort = ((InteropLab) proxy).getinteropTestPort();

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=442387&r1=442386&r2=442387
==============================================================================
--- 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 Mon Sep 11 16:51:32 2006
@@ -28,6 +28,7 @@
 import java.util.LinkedList;
 import java.util.Map;
 import java.util.StringTokenizer;
+import java.util.HashMap;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -43,11 +44,9 @@
 import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 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.util.NestedJarFile;
 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.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -57,13 +56,12 @@
 import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.j2ee.deployment.AppClientModule;
 import org.apache.geronimo.j2ee.deployment.EARContext;
-import org.apache.geronimo.j2ee.deployment.EJBReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
-import org.apache.geronimo.j2ee.deployment.RefContext;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.SecurityBuilder;
+import org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource;
+import org.apache.geronimo.j2ee.deployment.NamingBuilder;
+import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
@@ -71,20 +69,18 @@
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+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.kernel.repository.Repository;
-import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientDocument;
 import org.apache.geronimo.xbeans.geronimo.client.GerApplicationClientType;
 import org.apache.geronimo.xbeans.geronimo.client.GerResourceType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerAbstractNamingEntryDocument;
 import org.apache.geronimo.xbeans.j2ee.ApplicationClientDocument;
 import org.apache.geronimo.xbeans.j2ee.ApplicationClientType;
-import org.apache.geronimo.xbeans.j2ee.EjbLocalRefType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -92,22 +88,20 @@
 /**
  * @version $Rev:385232 $ $Date$
  */
-public class AppClientModuleBuilder implements ModuleBuilder {
+public class AppClientModuleBuilder implements ModuleBuilder, CorbaGBeanNameSource {
     private static final Log log = LogFactory.getLog(AppClientModuleBuilder.class);
     private static final String LINE_SEP = System.getProperty("line.separator");
-    
+
     private final Environment defaultClientEnvironment;
     private final Environment defaultServerEnvironment;
     private final AbstractNameQuery corbaGBeanObjectName;
 
     private final AbstractNameQuery transactionManagerObjectName;
     private final AbstractNameQuery connectionTrackerObjectName;
-    private final SingleElementCollection ejbReferenceBuilder;
     private final SingleElementCollection connectorModuleBuilder;
-    private final SingleElementCollection resourceReferenceBuilder;
-    private final SingleElementCollection serviceReferenceBuilder;
     private final SingleElementCollection securityBuilder;
     private final NamespaceDrivenBuilderCollection serviceBuilder;
+    private final NamingBuilderCollection namingBuilders;
 
     private static final String GERAPPCLIENT_NAMESPACE = GerApplicationClientDocument.type.getDocumentElementName().getNamespaceURI();
 
@@ -116,34 +110,28 @@
             AbstractNameQuery transactionManagerObjectName,
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery corbaGBeanObjectName,
-            EJBReferenceBuilder ejbReferenceBuilder,
             ModuleBuilder connectorModuleBuilder,
-            ResourceReferenceBuilder resourceReferenceBuilder,
-            ServiceReferenceBuilder serviceReferenceBuilder,
             NamespaceDrivenBuilder securityBuilder,
-            NamespaceDrivenBuilder serviceBuilder) {
+            NamespaceDrivenBuilder serviceBuilder,
+            Collection namingBuilders) {
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionManagerObjectName,
                 connectionTrackerObjectName,
                 corbaGBeanObjectName,
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(connectorModuleBuilder),
-                new SingleElementCollection(resourceReferenceBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 new SingleElementCollection(securityBuilder),
-                serviceBuilder == null? Collections.EMPTY_SET: Collections.singleton(serviceBuilder));
+                serviceBuilder == null ? Collections.EMPTY_SET : Collections.singleton(serviceBuilder),
+                namingBuilders == null ? Collections.EMPTY_SET : namingBuilders);
     }
 
     public AppClientModuleBuilder(AbstractNameQuery transactionManagerObjectName,
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery corbaGBeanObjectName,
-            Collection ejbReferenceBuilder,
             Collection connectorModuleBuilder,
-            Collection resourceReferenceBuilder,
-            Collection serviceReferenceBuilder,
             Collection securityBuilder,
             Collection serviceBuilder,
+            Collection namingBuilders,
             Environment defaultClientEnvironment,
             Environment defaultServerEnvironment) {
         this(defaultClientEnvironment,
@@ -151,12 +139,10 @@
                 transactionManagerObjectName,
                 connectionTrackerObjectName,
                 corbaGBeanObjectName,
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(connectorModuleBuilder),
-                new SingleElementCollection(resourceReferenceBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 new SingleElementCollection(securityBuilder),
-                serviceBuilder);
+                serviceBuilder,
+                namingBuilders);
     }
 
     private AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -164,41 +150,29 @@
             AbstractNameQuery transactionManagerObjectName,
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery corbaGBeanObjectName,
-            SingleElementCollection ejbReferenceBuilder,
             SingleElementCollection connectorModuleBuilder,
-            SingleElementCollection resourceReferenceBuilder,
-            SingleElementCollection serviceReferenceBuilder,
             SingleElementCollection securityBuilder,
-            Collection serviceBuilder) {
+            Collection serviceBuilder, Collection namingBuilders) {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
         this.transactionManagerObjectName = transactionManagerObjectName;
         this.connectionTrackerObjectName = connectionTrackerObjectName;
-        this.ejbReferenceBuilder = ejbReferenceBuilder;
         this.connectorModuleBuilder = connectorModuleBuilder;
-        this.resourceReferenceBuilder = resourceReferenceBuilder;
-        this.serviceReferenceBuilder = serviceReferenceBuilder;
         this.securityBuilder = securityBuilder;
         this.serviceBuilder = new NamespaceDrivenBuilderCollection(serviceBuilder);
+        this.namingBuilders = new NamingBuilderCollection(namingBuilders, GerAbstractNamingEntryDocument.type.getDocumentElementName());
     }
 
-    private EJBReferenceBuilder getEjbReferenceBuilder() {
-        return (EJBReferenceBuilder) ejbReferenceBuilder.getElement();
+
+    public AbstractNameQuery getCorbaGBeanName() {
+        return corbaGBeanObjectName;
     }
 
     private ModuleBuilder getConnectorModuleBuilder() {
         return (ModuleBuilder) connectorModuleBuilder.getElement();
     }
 
-    private ResourceReferenceBuilder getResourceReferenceBuilder() {
-        return (ResourceReferenceBuilder) resourceReferenceBuilder.getElement();
-    }
-
-    private ServiceReferenceBuilder getServiceReferenceBuilder() {
-        return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
-    }
-
     private org.apache.geronimo.j2ee.deployment.SecurityBuilder getSecurityBuilder() {
         return (SecurityBuilder) securityBuilder.getElement();
     }
@@ -248,9 +222,9 @@
 
         EnvironmentType clientEnvironmentType = gerAppClient.getClientEnvironment();
         Environment clientEnvironment = EnvironmentBuilder.buildEnvironment(clientEnvironmentType, defaultClientEnvironment);
-        if(standAlone) {
+        if (standAlone) {
             String name = new File(moduleFile.getName()).getName();
-            idBuilder.resolve(clientEnvironment, name+"_"+name, "jar");
+            idBuilder.resolve(clientEnvironment, name + "_" + name, "jar");
         } else {
             Artifact earConfigId = earEnvironment.getConfigId();
             idBuilder.resolve(clientEnvironment, earConfigId.getArtifactId() + "_" + new File(moduleFile.getName()).getName(), "jar");
@@ -260,13 +234,15 @@
         if (!standAlone) {
             EnvironmentBuilder.mergeEnvironments(earEnvironment, serverEnvironment);
             serverEnvironment = earEnvironment;
-            if(!serverEnvironment.getConfigId().isResolved()) {
-                throw new IllegalStateException("Server environment module ID should be fully resolved (not "+serverEnvironment.getConfigId()+")");
+            if (!serverEnvironment.getConfigId().isResolved()) {
+                throw new IllegalStateException("Server environment module ID should be fully resolved (not " + serverEnvironment.getConfigId() + ")");
             }
         } else {
             idBuilder.resolve(serverEnvironment, new File(moduleFile.getName()).getName(), "jar");
         }
 
+        namingBuilders.buildEnvironment(appClient, gerAppClient, clientEnvironment);
+
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(earEnvironment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
@@ -387,9 +363,10 @@
                     connectionTrackerObjectName,
                     null,
                     null,
-                    corbaGBeanObjectName,
-                    new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(), getServiceReferenceBuilder()));
+                    corbaGBeanObjectName
+            );
             appClientModule.setEarContext(appClientDeploymentContext);
+            appClientModule.setRootEarContext(earContext);
         } catch (DeploymentException e) {
             cleanupAppClientDir(appClientDir);
             throw e;
@@ -435,9 +412,9 @@
         Map componentContext;
         GBeanData appClientModuleGBeanData = new GBeanData(appClientModuleName, J2EEAppClientModuleImpl.GBEAN_INFO);
         try {
-            appClientModuleGBeanData.setReferencePatterns("J2EEServer", Collections.singleton(earContext.getServerName()));
+            appClientModuleGBeanData.setReferencePattern("J2EEServer", earContext.getServerName());
             if (!module.isStandAlone()) {
-                appClientModuleGBeanData.setReferencePatterns("J2EEApplication", Collections.singleton(earContext.getModuleName()));
+                appClientModuleGBeanData.setReferencePattern("J2EEApplication", earContext.getModuleName());
             }
             appClientModuleGBeanData.setAttribute("deploymentDescriptor", appClientModule.getOriginalSpecDD());
 
@@ -461,10 +438,7 @@
             try {
 
                 //register the message destinations in the app client ear context.
-                MessageDestinationType[] messageDestinations = appClient.getMessageDestinationArray();
-                GerMessageDestinationType[] gerMessageDestinations = geronimoAppClient.getMessageDestinationArray();
-
-                ENCConfigBuilder.registerMessageDestinations(appClientDeploymentContext.getRefContext(), appClientModule.getName(), messageDestinations, gerMessageDestinations);
+                namingBuilders.initContext(appClient, geronimoAppClient, appClientDeploymentContext.getConfiguration(), earContext.getConfiguration(), appClientModule);
                 // extract the client Jar file into a standalone packed jar file and add the contents to the output
                 URI moduleBase = new URI(appClientModule.getTargetPath());
                 try {
@@ -546,7 +520,7 @@
                 AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                 try {
-                    componentContext = buildComponentContext(appClientDeploymentContext, earContext, appClientModule, appClient, geronimoAppClient, appClientClassLoader);
+                    componentContext = buildComponentContext(appClientDeploymentContext, earContext, appClientModule, appClient, geronimoAppClient);
                     jndiContextGBeanData.setAttribute("context", componentContext);
                 } catch (DeploymentException e) {
                     throw e;
@@ -685,40 +659,29 @@
         }
     }
 
-    private Map buildComponentContext(EARContext appClientContext, EARContext ejbContext, AppClientModule appClientModule, ApplicationClientType appClient, GerApplicationClientType geronimoAppClient, ClassLoader cl) throws DeploymentException {
-
-        return ENCConfigBuilder.buildComponentContext(appClientContext,
-                ejbContext.getConfiguration(),
-                appClientModule,
-                null, //no user transaction yet
-                appClient.getEnvEntryArray(),
-                appClient.getEjbRefArray(), geronimoAppClient.getEjbRefArray(),
-                new EjbLocalRefType[0], null,
-                appClient.getResourceRefArray(), geronimoAppClient.getResourceRefArray(),
-                appClient.getResourceEnvRefArray(), geronimoAppClient.getResourceEnvRefArray(),
-                appClient.getMessageDestinationRefArray(),
-                appClient.getServiceRefArray(), geronimoAppClient.getServiceRefArray(),
-                geronimoAppClient.getGbeanRefArray(),
-                cl);
-
+    private Map buildComponentContext(EARContext appClientContext, EARContext ejbContext, AppClientModule appClientModule, ApplicationClientType appClient, GerApplicationClientType geronimoAppClient) throws DeploymentException {
+        Map componentContext = new HashMap();
+        Configuration localConfiguration = appClientContext.getConfiguration();
+        Configuration remoteConfiguration = ejbContext.getConfiguration();
+        namingBuilders.buildNaming(appClient, geronimoAppClient, localConfiguration, remoteConfiguration, appClientModule, componentContext);
+        return componentContext;
     }
 
-    private boolean cleanupAppClientDir(File configurationDir)
-    {
+    private boolean cleanupAppClientDir(File configurationDir) {
         LinkedList cannotBeDeletedList = new LinkedList();
-               
-        if (!DeploymentUtil.recursiveDelete(configurationDir,cannotBeDeletedList)) {
+
+        if (!DeploymentUtil.recursiveDelete(configurationDir, cannotBeDeletedList)) {
             // Output a message to help user track down file problem
-            log.warn("Unable to delete " + cannotBeDeletedList.size() + 
-                    " files while recursively deleting directory " 
+            log.warn("Unable to delete " + cannotBeDeletedList.size() +
+                    " files while recursively deleting directory "
                     + configurationDir + LINE_SEP +
-                    "The first file that could not be deleted was:" + LINE_SEP + "  "+
-                    ( !cannotBeDeletedList.isEmpty() ? cannotBeDeletedList.getFirst() : "") );
+                    "The first file that could not be deleted was:" + LINE_SEP + "  " +
+                    (!cannotBeDeletedList.isEmpty() ? cannotBeDeletedList.getFirst() : ""));
             return false;
         }
         return true;
-    }  
-    
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
@@ -728,24 +691,20 @@
         infoBuilder.addAttribute("transactionManagerObjectName", AbstractNameQuery.class, true);
         infoBuilder.addAttribute("connectionTrackerObjectName", AbstractNameQuery.class, true);
         infoBuilder.addAttribute("corbaGBeanObjectName", AbstractNameQuery.class, true);
-        infoBuilder.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ConnectorModuleBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilder", SecurityBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
 
         infoBuilder.addInterface(ModuleBuilder.class);
 
         infoBuilder.setConstructor(new String[]{"transactionManagerObjectName",
                 "connectionTrackerObjectName",
                 "corbaGBeanObjectName",
-                "EJBReferenceBuilder",
                 "ConnectorModuleBuilder",
-                "ResourceReferenceBuilder",
-                "ServiceReferenceBuilder",
                 "SecurityBuilder",
                 "ServiceBuilders",
+                "NamingBuilders",
                 "defaultClientEnvironment",
                 "defaultServerEnvironment",
         });

Modified: geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java Mon Sep 11 16:51:32 2006
@@ -19,7 +19,7 @@
     private AppClientModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null, null, null);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null);
     }
 
     public void testResourceRef() throws Exception {

Added: 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=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,257 @@
+/**
+ *
+ * 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.deployment;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.naming.Reference;
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.common.UnresolvedReferenceException;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+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.reference.ResourceReference;
+import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
+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;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @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 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 void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+        XmlObject[] specDestinations = specDD.selectChildren(MESSAGE_DESTINATION_QNAME_SET);
+        XmlObject[] gerDestinations = plan.selectChildren(GER_MESSAGE_DESTINATION_QNAME_SET);
+            Map nameMap = new HashMap();
+            for (int i = 0; i < gerDestinations.length; i++) {
+                GerMessageDestinationType destination = (GerMessageDestinationType) gerDestinations[i].copy().changeType(GerMessageDestinationType.type);
+                String name = destination.getMessageDestinationName().trim();
+                nameMap.put(name, destination);
+                boolean found = false;
+                for (int j = 0; j < specDestinations.length; j++) {
+                    MessageDestinationType specDestination = (MessageDestinationType) specDestinations[j].copy().changeType(MessageDestinationType.type);
+                    if (specDestination.getMessageDestinationName().getStringValue().trim().equals(name)) {
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found) {
+                    throw new DeploymentException("No spec DD message-destination for " + name);
+                }
+            }
+            module.getRootEarContext().registerMessageDestionations(module.getName(), nameMap);
+    }
+
+
+    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);
+        ClassLoader cl = localConfiguration.getConfigurationClassLoader();
+        XmlObject[] gerResourceEnvRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GER_ADMIN_OBJECT_REF_QNAME_SET);
+        Map refMap = mapResourceEnvRefs(gerResourceEnvRefsUntyped);
+        for (int i = 0; i < resourceEnvRefsUntyped.length; i++) {
+            ResourceEnvRefType resourceEnvRef = (ResourceEnvRefType) resourceEnvRefsUntyped[i];
+            String name = resourceEnvRef.getResourceEnvRefName().getStringValue().trim();
+            String type = resourceEnvRef.getResourceEnvRefType().getStringValue().trim();
+            Class iface;
+            try {
+                iface = cl.loadClass(type);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("could not load class " + type, e);
+            }
+            GerResourceEnvRefType gerResourceEnvRef = (GerResourceEnvRefType) refMap.get(name);
+            try {
+                AbstractNameQuery containerId = getAdminObjectContainerId(name, gerResourceEnvRef);
+                Reference ref = buildAdminObjectReference(localConfiguration, containerId, iface);
+                componentContext.put(ENV + name, ref);
+            } catch (UnresolvedReferenceException e) {
+                throw new DeploymentException("Unable to resolve resource env reference '" + name + "' (" + (e.isMultiple() ? "found multiple matching resources" : "no matching resources found") + ")");
+            }
+        }
+
+        //message-destination-refs
+        XmlObject[] messageDestinationRefsUntyped = specDD.selectChildren(MESSAGE_DESTINATION_REF_QNAME);
+
+        for (int i = 0; i < messageDestinationRefsUntyped.length; i++) {
+            MessageDestinationRefType messageDestinationRef = (MessageDestinationRefType) messageDestinationRefsUntyped[i].copy().changeType(MessageDestinationRefType.type);
+            String name = getStringValue(messageDestinationRef.getMessageDestinationRefName());
+            String linkName = getStringValue(messageDestinationRef.getMessageDestinationLink());
+            String type = getStringValue(messageDestinationRef.getMessageDestinationType());
+            Class iface;
+            try {
+                iface = cl.loadClass(type);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("could not load class " + type, e);
+            }
+            String moduleURI = null;
+            Map messageDestinations = module.getRootEarContext().getMessageDestinations();
+            GerMessageDestinationType destination = getMessageDestination(linkName, messageDestinations);
+            if (destination != null) {
+                if (destination.isSetAdminObjectLink()) {
+                    if (destination.isSetAdminObjectModule()) {
+                        moduleURI = destination.getAdminObjectModule().trim();
+                    }
+                    linkName = destination.getAdminObjectLink().trim();
+                }
+            } else {
+                //well, we know for sure an admin object is not going to be defined in a modules that can have a message-destination
+                int pos = linkName.indexOf('#');
+                if (pos > -1) {
+                    //AMM -- the following line causes blowups; e.g. to look in DayTrader EJB module for a RA -- why is that?!?
+                    //moduleURI = linkName.substring(0, pos);
+                    linkName = linkName.substring(pos + 1);
+                }
+            }
+
+            //try to resolve ref based only matching resource-ref-name
+            //throws exception if it can't locate ref.
+            AbstractNameQuery containerId = buildAbstractNameQuery(null, moduleURI, linkName, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
+            Reference ref = buildAdminObjectReference(localConfiguration, containerId, iface);
+            componentContext.put(ENV + name, ref);
+
+        }
+
+    }
+
+    public static GerMessageDestinationType getMessageDestination(String messageDestinationLink, Map messageDestinations) throws DeploymentException {
+        GerMessageDestinationType destination = null;
+        int pos = messageDestinationLink.indexOf('#');
+        if (pos > -1) {
+            String targetModule = messageDestinationLink.substring(0, pos);
+            Map destinations = (Map) messageDestinations.get(targetModule);
+            // Hmmm...if we don't find the module then something is wrong in the deployment.
+            if (destinations == null) {
+                StringBuffer sb = new StringBuffer();
+                for (Iterator mapIterator = messageDestinations.keySet().iterator(); mapIterator.hasNext();) {
+                    sb.append(mapIterator.next()).append("\n");
+                }
+                throw new DeploymentException("Unknown module " + targetModule + " when processing message destination " + messageDestinationLink +
+                        "\nKnown modules in deployable unit are:\n" + sb.toString());
+            }
+            messageDestinationLink = messageDestinationLink.substring(pos + 1);
+            destination = (GerMessageDestinationType) destinations.get(messageDestinationLink);
+        } else {
+            for (Iterator iterator = messageDestinations.values().iterator(); iterator.hasNext();) {
+                Map destinations = (Map) iterator.next();
+                GerMessageDestinationType destinationTest = (GerMessageDestinationType) destinations.get(messageDestinationLink);
+                if (destinationTest != null) {
+                    if (destination != null) {
+                        throw new DeploymentException("Duplicate message destination " + messageDestinationLink + " accessed from a message-destination-link without a module");
+                    }
+                    destination = destinationTest;
+                }
+            }
+        }
+        return destination;
+    }
+
+
+    private Reference buildAdminObjectReference(Configuration localConfiguration, AbstractNameQuery containerId, Class iface) throws DeploymentException {
+        try {
+            localConfiguration.findGBean(containerId);
+        } catch (GBeanNotFoundException e) {
+            throw new DeploymentException("Can not resolve admin object ref " + containerId + " in configuration " + localConfiguration.getId());
+        }
+        return new ResourceReference(localConfiguration.getId(), containerId, iface);
+    }
+
+    private static AbstractNameQuery getAdminObjectContainerId(String name, GerResourceEnvRefType gerResourceEnvRef) {
+        AbstractNameQuery containerId;
+        if (gerResourceEnvRef == null) {
+            containerId = buildAbstractNameQuery(null, null, name, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
+        } else if (gerResourceEnvRef.isSetMessageDestinationLink()) {
+            containerId = buildAbstractNameQuery(null, null, gerResourceEnvRef.getMessageDestinationLink().trim(), NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
+        } else if (gerResourceEnvRef.isSetAdminObjectLink()) {
+            String moduleURI = null;
+            if (gerResourceEnvRef.isSetAdminObjectModule()) {
+                moduleURI = gerResourceEnvRef.getAdminObjectModule().trim();
+            }
+            containerId = buildAbstractNameQuery(null, moduleURI, gerResourceEnvRef.getAdminObjectLink().trim(), NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE);
+        } else {
+            //construct name from components
+            GerPatternType patternType = gerResourceEnvRef.getPattern();
+            containerId = buildAbstractNameQuery(patternType, NameFactory.JCA_ADMIN_OBJECT, NameFactory.RESOURCE_ADAPTER_MODULE, null);
+        }
+        return containerId;
+    }
+
+    private static Map mapResourceEnvRefs(XmlObject[] refs) {
+        Map refMap = new HashMap();
+        if (refs != null) {
+            for (int i = 0; i < refs.length; i++) {
+                GerResourceEnvRefType ref = (GerResourceEnvRefType) refs[i].copy().changeType(GerResourceEnvRefType.type);
+                refMap.put(ref.getRefName().trim(), ref);
+            }
+        }
+        return refMap;
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return ADMIN_OBJECT_REF_QNAME_SET;
+    }
+
+    public QNameSet getPlanQNameSet() {
+        return GER_ADMIN_OBJECT_REF_QNAME_SET;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AdminObjectRefBuilder.class, NameFactory.MODULE_BUILDER);
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Mon Sep 11 16:51:32 2006
@@ -80,7 +80,7 @@
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
+import org.apache.geronimo.j2ee.deployment.ActivationSpecInfoLocator;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
@@ -121,7 +121,7 @@
 /**
  * @version $Rev:385659 $ $Date$
  */
-public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
+public class ConnectorModuleBuilder implements ModuleBuilder, ActivationSpecInfoLocator {
     private static QName CONNECTOR_QNAME = GerConnectorDocument.type.getDocumentElementName();
     static final String GERCONNECTOR_NAMESPACE = CONNECTOR_QNAME.getNamespaceURI();
 
@@ -416,7 +416,7 @@
                 resourceAdapterInstanceGBeanData.setReferencePattern("WorkManager", workManagerName);
 
                 // set the xa terminator name which is the same as our transaction manager
-                resourceAdapterInstanceGBeanData.setReferencePattern("XATerminator", earContext.getTransactionManagerObjectName());
+                resourceAdapterInstanceGBeanData.setReferencePattern("XATerminator", earContext.getTransactionManagerName());
 
                 String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
                 resourceAdapterAbstractName = earContext.getNaming().createChildName(jcaResourceName, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
@@ -724,9 +724,9 @@
         try {
             connectionManagerGBean.setAttribute("transactionSupport", transactionSupport);
             connectionManagerGBean.setAttribute("pooling", pooling);
-            connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerObjectName());
+            connectionManagerGBean.setReferencePattern("ConnectionTracker", earContext.getConnectionTrackerName());
             connectionManagerGBean.setAttribute("containerManagedSecurity", Boolean.valueOf(connectionManager.isSetContainerManagedSecurity()));
-            connectionManagerGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerObjectName());
+            connectionManagerGBean.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
         } catch (Exception e) {
             throw new DeploymentException("Problem setting up ConnectionManager named " + connectionfactoryInstance.getName().trim(), e);
         }
@@ -786,7 +786,7 @@
         }
     }
 
-    //ResourceReferenceBuilder implementation
+    //ResourceRefBuilder implementation
     public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) throws DeploymentException {
         try {
             configuration.findGBean(containerId);
@@ -875,7 +875,7 @@
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
 
         infoBuilder.addInterface(ModuleBuilder.class);
-        infoBuilder.addInterface(ResourceReferenceBuilder.class);
+        infoBuilder.addInterface(ActivationSpecInfoLocator.class);
 
         infoBuilder.setConstructor(new String[]{"defaultEnvironment",
                 "defaultMaxSize",



Mime
View raw message