geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r442387 [3/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
Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java Mon Sep 11 16:51:32 2006
@@ -20,25 +20,20 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.net.URI;
-import java.util.List;
-import java.util.Map;
+
 import javax.management.ObjectName;
 import javax.naming.Reference;
-import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.common.UnresolvedEJBRefException;
-import org.apache.geronimo.common.UnresolvedReferenceException;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.Jsr77Naming;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
  * @version $Rev:385692 $ $Date$
@@ -56,121 +51,118 @@
 
     private AbstractName car_enzo;
 
-    private RefContext refContext;
     private Configuration configuration;
 
     public void testNothing() throws Exception {}
 
-    public void xtestSimpleRefs() throws Exception {
-        assertReferenceEqual(coffee_peaberry, refContext.getEJBRemoteRef(null, configuration, "peaberry", null, coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_peaberry, refContext.getEJBLocalRef(null, configuration, "peaberry", null, coffee, null, null, true, null, null));
-    }
-
-    public void xtestAmbiguousRefs() throws Exception {
-        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", null, coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", null, coffee, null, null, true, null, null));
-        assertReferenceEqual(language_java, refContext.getEJBRemoteRef(null, configuration, "java", null, language, null, null, true, null, null));
-        assertReferenceEqual(language_java, refContext.getEJBLocalRef(null, configuration, "java", null, language, null, null, true, null, null));
-
-        try {
-            refContext.getEJBRemoteRef(null, configuration, "java", null, car, null, null, true, null, null);
-            fail("should have thrown an AmbiguousEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-        try {
-            refContext.getEJBLocalRef(null, configuration, "java", null, car, null, null, true, null, null);
-            fail("should have thrown an AmbiguousEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-    }
-
-    public void xtestRelativeRefs() throws Exception {
-        assertReferenceEqual(car_enzo, refContext.getEJBRemoteRef(null, configuration, "enzo", "../../foo/bar/car.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "enzo", "../../foo/bar/car.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(car_enzo, refContext.getEJBRemoteRef(null, configuration, "enzo", "./../funk/../../foo/bar/car.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "enzo", "./../funk/../../foo/bar/car.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", "./coffee.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", "./coffee.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", "coffee.jar", coffee, null, null, true, null, null));
-        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", "coffee.jar", coffee, null, null, true, null, null));
-
-        try {
-            refContext.getEJBRemoteRef(null, configuration, "blah", "not_exist.jar", coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-
-        try {
-            refContext.getEJBLocalRef(null, configuration, "blah", "not_exist.jar", coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-
-        try {
-            refContext.getEJBRemoteRef(null, configuration, "blah", "coffee.jar", coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-
-        try {
-            refContext.getEJBLocalRef(null, configuration, "blah", "coffee.jar", coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-
-        try {
-            refContext.getEJBRemoteRef(null, configuration, "enzo", "../../../../foo/bar/car.jar",coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-        try {
-            refContext.getEJBLocalRef(null, configuration, "enzo", "../../../../foo/bar/car.jar",coffee, null, null, true, null, null);
-            fail("should have thrown an UnknownEJBRefException");
-        } catch (UnresolvedReferenceException e) {
-            // good
-        }
-    }
-
-    public void xtestBasicImplicitRefs() throws Exception {
-        assertReferenceEqual(language_lisp, refContext.getEJBRemoteRef(null, configuration, "blah", null, coffee, null, null, true, "LispHome", "LispRemote"));
-        assertReferenceEqual(language_lisp, refContext.getEJBLocalRef(null, configuration, "blah", null, coffee, null, null, true, "LispLocalHome", "LispLocal"));
-    }
-
-    public void xtestInModuleImplicitRefs() throws Exception {
-        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "blah", null, coffee, null, null, true, "LocalHome", "Local"));
-        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "blah", null, car, null, null, true, "LocalHome", "Local"));
-    }
-
-    public void xtestAmbiguousModuleImplicitRefs() throws Exception {
-        try {
-            refContext.getEJBLocalRef(null, configuration, "blah", null, language, null, null, true, "LocalHome", "Local");
-            fail("should have thrown an UnresolvedEJBRefException");
-        } catch (UnresolvedEJBRefException e) {
-            // good
-        }
-    }
-
-    public void xtestNoMatchImplicitRefs() throws Exception {
-        try {
-            refContext.getEJBLocalRef(null, configuration, "blah", null, language, null, null, true, "foo", "bar");
-            fail("should have thrown an UnresolvedEJBRefException");
-        } catch (UnresolvedEJBRefException e) {
-            // good
-        }
-    }
-
+//    public void xtestSimpleRefs() throws Exception {
+//        assertReferenceEqual(coffee_peaberry, refContext.getEJBRemoteRef(null, configuration, "peaberry", null, coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_peaberry, refContext.getEJBLocalRef(null, configuration, "peaberry", null, coffee, null, null, true, null, null));
+//    }
+//
+//    public void xtestAmbiguousRefs() throws Exception {
+//        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", null, coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", null, coffee, null, null, true, null, null));
+//        assertReferenceEqual(language_java, refContext.getEJBRemoteRef(null, configuration, "java", null, language, null, null, true, null, null));
+//        assertReferenceEqual(language_java, refContext.getEJBLocalRef(null, configuration, "java", null, language, null, null, true, null, null));
+//
+//        try {
+//            refContext.getEJBRemoteRef(null, configuration, "java", null, car, null, null, true, null, null);
+//            fail("should have thrown an AmbiguousEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "java", null, car, null, null, true, null, null);
+//            fail("should have thrown an AmbiguousEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//    }
+//
+//    public void xtestRelativeRefs() throws Exception {
+//        assertReferenceEqual(car_enzo, refContext.getEJBRemoteRef(null, configuration, "enzo", "../../foo/bar/car.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "enzo", "../../foo/bar/car.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(car_enzo, refContext.getEJBRemoteRef(null, configuration, "enzo", "./../funk/../../foo/bar/car.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "enzo", "./../funk/../../foo/bar/car.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", "./coffee.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", "./coffee.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_java, refContext.getEJBRemoteRef(null, configuration, "java", "coffee.jar", coffee, null, null, true, null, null));
+//        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "java", "coffee.jar", coffee, null, null, true, null, null));
+//
+//        try {
+//            refContext.getEJBRemoteRef(null, configuration, "blah", "not_exist.jar", coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "blah", "not_exist.jar", coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//
+//        try {
+//            refContext.getEJBRemoteRef(null, configuration, "blah", "coffee.jar", coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "blah", "coffee.jar", coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//
+//        try {
+//            refContext.getEJBRemoteRef(null, configuration, "enzo", "../../../../foo/bar/car.jar",coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "enzo", "../../../../foo/bar/car.jar",coffee, null, null, true, null, null);
+//            fail("should have thrown an UnknownEJBRefException");
+//        } catch (UnresolvedReferenceException e) {
+//            // good
+//        }
+//    }
+//
+//    public void xtestBasicImplicitRefs() throws Exception {
+//        assertReferenceEqual(language_lisp, refContext.getEJBRemoteRef(null, configuration, "blah", null, coffee, null, null, true, "LispHome", "LispRemote"));
+//        assertReferenceEqual(language_lisp, refContext.getEJBLocalRef(null, configuration, "blah", null, coffee, null, null, true, "LispLocalHome", "LispLocal"));
+//    }
+//
+//    public void xtestInModuleImplicitRefs() throws Exception {
+//        assertReferenceEqual(coffee_java, refContext.getEJBLocalRef(null, configuration, "blah", null, coffee, null, null, true, "LocalHome", "Local"));
+//        assertReferenceEqual(car_enzo, refContext.getEJBLocalRef(null, configuration, "blah", null, car, null, null, true, "LocalHome", "Local"));
+//    }
+//
+//    public void xtestAmbiguousModuleImplicitRefs() throws Exception {
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "blah", null, language, null, null, true, "LocalHome", "Local");
+//            fail("should have thrown an UnresolvedEJBRefException");
+//        } catch (UnresolvedEJBRefException e) {
+//            // good
+//        }
+//    }
+//
+//    public void xtestNoMatchImplicitRefs() throws Exception {
+//        try {
+//            refContext.getEJBLocalRef(null, configuration, "blah", null, language, null, null, true, "foo", "bar");
+//            fail("should have thrown an UnresolvedEJBRefException");
+//        } catch (UnresolvedEJBRefException e) {
+//            // good
+//        }
+//    }
+//
     protected void setUp() throws Exception {
         super.setUp();
 
-        refContext = new RefContext(new MockEjbReferenceBuilder(), new MockResourceReferenceBuilder(), new MockServiceReferenceBuilder());
-
         Naming naming = new Jsr77Naming();
         AbstractName applicationName = naming.createRootName(new Artifact("test", "stuff", "", "ear"), "app", NameFactory.J2EE_APPLICATION) ;
 
@@ -235,30 +227,7 @@
         }
     }
 
-    private class MockEjbReferenceBuilder implements EJBReferenceBuilder {
-        public Reference createEJBLocalReference(String objectName, GBeanData gbeanData, boolean isSession, String localHome, String local) {
-            return new FakeReference(objectName);
-        }
-
-        public Reference createEJBRemoteReference(GBeanData gbeanData, boolean isSession, String home, String remote) {
-            return new FakeReference(null);
-        }
-
-        public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) throws DeploymentException {
-            return new FakeReference(objectName);
-        }
-
-        public Reference createEJBRemoteRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote) throws DeploymentException {
-            return null;
-        }
-
-        public Reference createEJBLocalRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local) throws DeploymentException {
-            return null;
-        }
-
-   }
-
-    private static class MockResourceReferenceBuilder implements ResourceReferenceBuilder {
+    private static class MockActivationSpecInfoLocator implements ActivationSpecInfoLocator {
         public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) {
             return null;
         }
@@ -288,10 +257,4 @@
         }
     }
 
-    private static class MockServiceReferenceBuilder implements ServiceReferenceBuilder {
-        //it could return a Service or a Reference, we don't care
-        public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
-            return null;
-        }
-    }
 }

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java Mon Sep 11 16:51:32 2006
@@ -42,7 +42,7 @@
 /**
  * @version $Rev:385692 $ $Date$
  */
-public class MockConnectorConfigBuilder extends Assert implements ModuleBuilder, ResourceReferenceBuilder{
+public class MockConnectorConfigBuilder extends Assert implements ModuleBuilder, ActivationSpecInfoLocator {
     private EARContext earContext;
     private ClassLoader cl;
     public Module connectorModule;

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java Mon Sep 11 16:51:32 2006
@@ -42,7 +42,7 @@
 /**
  * @version $Rev:385692 $ $Date$
  */
-public class MockEJBConfigBuilder extends Assert implements ModuleBuilder, EJBReferenceBuilder {
+public class MockEJBConfigBuilder extends Assert implements ModuleBuilder {
     private EARContext earContext;
     private ClassLoader cl;
     public EJBModule ejbModule;
@@ -85,18 +85,6 @@
     }
 
     public String getSchemaNamespace() {
-        return null;
-    }
-
-    public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) throws DeploymentException {
-        return null;
-    }
-
-    public Reference createEJBRemoteRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote) throws DeploymentException {
-        return null;
-    }
-
-    public Reference createEJBLocalRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local) throws DeploymentException {
         return null;
     }
 

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=442387&r1=442386&r2=442387
==============================================================================
--- 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 Mon Sep 11 16:51:32 2006
@@ -62,6 +62,7 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.Host;
 import org.apache.geronimo.jetty.JettyDefaultServletHolder;
@@ -75,6 +76,7 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
@@ -84,7 +86,6 @@
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.web.deployment.AbstractWebModuleBuilder;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
-import org.apache.geronimo.xbeans.geronimo.naming.GerMessageDestinationType;
 import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
@@ -98,7 +99,6 @@
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingListType;
 import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingType;
 import org.apache.geronimo.xbeans.j2ee.LoginConfigType;
-import org.apache.geronimo.xbeans.j2ee.MessageDestinationType;
 import org.apache.geronimo.xbeans.j2ee.MimeMappingType;
 import org.apache.geronimo.xbeans.j2ee.ParamValueType;
 import org.apache.geronimo.xbeans.j2ee.ServletMappingType;
@@ -145,8 +145,9 @@
             Collection webServiceBuilder,
             Collection securityBuilders,
             Collection serviceBuilders,
+            NamingBuilder namingBuilders,
             Kernel kernel) throws GBeanNotFoundException {
-        super(kernel, securityBuilders, serviceBuilders);
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
@@ -221,6 +222,9 @@
 
         EnvironmentType environmentType = jettyWebApp.getEnvironment();
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
+
+        getNamingBuilders().buildEnvironment(webApp, jettyWebApp, environment);
+        
         // Note: logic elsewhere depends on the default artifact ID being the file name less extension (ConfigIDExtractor)
         String warName = new File(moduleFile.getName()).getName();
         if (warName.lastIndexOf('.') > -1) {
@@ -301,11 +305,12 @@
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
         WebAppType webApp = (WebAppType) module.getSpecDD();
-        MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
+//        MessageDestinationType[] messageDestinations = webApp.getMessageDestinationArray();
         JettyWebAppType gerWebApp = (JettyWebAppType) module.getVendorDD();
-        GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
+//        GerMessageDestinationType[] gerMessageDestinations = gerWebApp.getMessageDestinationArray();
 
-        ENCConfigBuilder.registerMessageDestinations(earContext.getRefContext(), module.getName(), messageDestinations, gerMessageDestinations);
+//        ENCConfigBuilder.registerMessageDestinations(earContext, module.getName(), messageDestinations, gerMessageDestinations);
+        getNamingBuilders().initContext(webApp, gerWebApp, module.getEarContext().getConfiguration(), earContext.getConfiguration(), module);
         if ((webApp.getSecurityConstraintArray().length > 0 || webApp.getSecurityRoleArray().length > 0) &&
                 !gerWebApp.isSetSecurityRealmName()) {
             throw new DeploymentException("web.xml for web app " + module.getName() + " includes security elements but Geronimo deployment plan is not provided or does not contain <security-realm-name> element necessary to configure security accordingly.");
@@ -380,8 +385,8 @@
 
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 
-            webModuleData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerObjectName());
-            webModuleData.setReferencePattern("TrackedConnectionAssociator", moduleContext.getConnectionTrackerObjectName());
+            webModuleData.setReferencePattern("TransactionManager", moduleContext.getTransactionManagerName());
+            webModuleData.setReferencePattern("TrackedConnectionAssociator", moduleContext.getConnectionTrackerName());
             if (jettyWebApp.isSetWebContainer()) {
                 AbstractNameQuery webContainerName = ENCConfigBuilder.getGBeanQuery(NameFactory.GERONIMO_SERVICE, jettyWebApp.getWebContainer());
                 webModuleData.setReferencePattern("JettyContainer", webContainerName);
@@ -894,19 +899,10 @@
     }
 
     private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, ClassLoader cl) throws DeploymentException {
-        return ENCConfigBuilder.buildComponentContext(earContext,
-                earContext.getConfiguration(),
-                webModule,
-                null,
-                webApp.getEnvEntryArray(),
-                webApp.getEjbRefArray(), jettyWebApp.getEjbRefArray(),
-                webApp.getEjbLocalRefArray(), jettyWebApp.getEjbLocalRefArray(),
-                webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray(),
-                webApp.getResourceEnvRefArray(), jettyWebApp.getResourceEnvRefArray(),
-                webApp.getMessageDestinationRefArray(),
-                webApp.getServiceRefArray(), jettyWebApp.getServiceRefArray(),
-                jettyWebApp.getGbeanRefArray(),
-                cl);
+        Map componentContext = new HashMap();
+        Configuration earConfiguration = earContext.getConfiguration();
+        getNamingBuilders().buildNaming(webApp, jettyWebApp, earConfiguration, earConfiguration, webModule, componentContext);
+        return componentContext;
     }
 
     public static final GBeanInfo GBEAN_INFO;
@@ -924,6 +920,7 @@
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -939,6 +936,7 @@
                 "WebServiceBuilder",
                 "SecurityBuilders",
                 "ServiceBuilders",
+                "NamingBuilders",
                 "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=442387&r1=442386&r2=442387
==============================================================================
--- 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 Mon Sep 11 16:51:32 2006
@@ -19,26 +19,19 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import javax.management.ObjectName;
-import javax.naming.Reference;
-import javax.xml.namespace.QName;
-
 import org.apache.geronimo.testsupport.TestSupport;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinatorGBean;
-import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
@@ -49,13 +42,10 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 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.RefContext;
-import org.apache.geronimo.j2ee.deployment.ResourceReferenceBuilder;
-import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.UnavailableWebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.jetty.JettyContainerImpl;
@@ -121,6 +111,7 @@
         AbstractName moduleName = module.getModuleName();
         EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
         module.setEarContext(earContext);
+        module.setRootEarContext(earContext);
         builder.initContext(earContext, module, cl);
         builder.addGBeans(earContext, module, cl, Collections.EMPTY_SET);
         ConfigurationData configurationData = earContext.getConfigurationData();
@@ -158,6 +149,7 @@
         AbstractName moduleName = module.getModuleName();
         EARContext earContext = createEARContext(outputPath, defaultEnvironment, repository, configStore, moduleName);
         module.setEarContext(earContext);
+        module.setRootEarContext(earContext);
         builder.initContext(earContext, module, cl);
         builder.addGBeans(earContext, module, cl, Collections.EMPTY_SET);
         ConfigurationData configurationData = earContext.getConfigurationData();
@@ -195,59 +187,8 @@
                 new AbstractNameQuery(ctcName),
                 null,
                 null,
-                null,
-                new RefContext(new EJBReferenceBuilder() {
-
-
-                    public Reference createCORBAReference(Configuration configuration, AbstractNameQuery containerNameQuery, URI nsCorbaloc, String objectName, String home) {
-                        return null;
-                    }
-
-                    public Reference createEJBRemoteRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String home, String remote) {
-                        return null;
-                    }
-
-                    public Reference createEJBLocalRef(String refName, Configuration configuration, String name, String requiredModule, String optionalModule, Artifact targetConfigId, AbstractNameQuery query, boolean isSession, String localHome, String local) {
-                        return null;
-                    }
-
-                },
-                        new ResourceReferenceBuilder() {
-
-                            public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) {
-                                return null;
-                            }
-
-                            public Reference createAdminObjectRef(AbstractNameQuery containerId, Class iface, Configuration configuration) {
-                                return null;
-                            }
-
-                            public ObjectName locateResourceName(ObjectName query) {
-                                return null;
-                            }
-
-                            public GBeanData locateActivationSpecInfo(AbstractNameQuery nameQuery, String messageListenerInterface, Configuration configuration) {
-                                return null;
-                            }
-
-                            public GBeanData locateResourceAdapterGBeanData(GBeanData resourceAdapterModuleData) {
-                                return null;
-                            }
-
-                            public GBeanData locateAdminObjectInfo(GBeanData resourceAdapterModuleData, String adminObjectInterfaceName) {
-                                return null;
-                            }
-
-                            public GBeanData locateConnectionFactoryInfo(GBeanData resourceAdapterModuleData, String connectionFactoryInterfaceName) {
-                                return null;
-                            }
-                        },
-                        new ServiceReferenceBuilder() {
-                            //it could return a Service or a Reference, we don't care
-                            public Object createService(Class serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlerInfos, Object serviceRefType, DeploymentContext deploymentContext, Module module, ClassLoader classLoader) {
-                                return null;
-                            }
-                        }));
+                null
+        );
     }
 
     private void recursiveDelete(File path) {
@@ -324,7 +265,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), Collections.EMPTY_LIST, new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), kernel);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), Collections.EMPTY_LIST, new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), kernel);
     }
 
     protected void tearDown() throws Exception {

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=442387&r1=442386&r2=442387
==============================================================================
--- 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 Mon Sep 11 16:51:32 2006
@@ -6,11 +6,11 @@
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
-import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
 import org.apache.geronimo.deployment.service.GBeanBuilder;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.Naming;
@@ -53,7 +53,7 @@
     private JettyModuleBuilder builder;
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), null);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), null, jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), null);
     }
 
     public void testContents() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/server/trunk/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java Mon Sep 11 16:51:32 2006
@@ -248,7 +248,10 @@
         setAuthenticator(authenticator);
         setRealmName(realmName);
         setTagLibMap(tagLibMap);
-        setSessionTimeoutSeconds(sessionTimeoutSeconds);
+
+        if (false == distributable) {
+            setSessionTimeoutSeconds(sessionTimeoutSeconds);
+        }
 
         GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
         Context enc = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext, userTransaction, kernel, webClassLoader);

Added: 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=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,139 @@
+/**
+ *
+ * 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.naming.deployment;
+
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+
+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.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.NamingBuilder;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public abstract class AbstractNamingBuilder implements NamingBuilder {
+
+    private final Environment defaultEnvironment;
+
+    protected AbstractNamingBuilder() {
+        defaultEnvironment = null;
+    }
+
+    protected AbstractNamingBuilder(Environment defaultEnvironment) {
+        this.defaultEnvironment = defaultEnvironment;
+    }
+
+    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
+        if (willMergeEnvironment(specDD, plan)) {
+            EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
+        }
+    }
+
+    protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
+        return false;
+    }
+
+    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+    }
+
+    protected 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 AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type, String moduleType, Set interfaceTypes) {
+        String groupId = pattern.isSetGroupId() ? pattern.getGroupId().trim() : null;
+        String artifactid = pattern.isSetArtifactId() ? pattern.getArtifactId().trim() : null;
+        String version = pattern.isSetVersion() ? pattern.getVersion().trim() : null;
+        String module = pattern.isSetModule() ? pattern.getModule().trim() : null;
+        String name = pattern.getName().trim();
+
+        Artifact artifact = artifactid != null ? new Artifact(groupId, artifactid, version, null) : null;
+        Map nameMap = new HashMap();
+        nameMap.put("name", name);
+        if (type != null) {
+            nameMap.put("j2eeType", type);
+        }
+        if (module != null && moduleType != null) {
+            nameMap.put(moduleType, module);
+        }
+        if(interfaceTypes != null) {
+            Set trimmed = new HashSet();
+            for (Iterator it = interfaceTypes.iterator(); it.hasNext();) {
+                String intf = (String) it.next();
+                trimmed.add(intf == null ? null : intf.trim());
+            }
+            interfaceTypes = trimmed;
+        }
+        return new AbstractNameQuery(artifact, nameMap, interfaceTypes);
+    }
+
+    public static AbstractNameQuery buildAbstractNameQuery(Artifact configId, String module, String name, String type, String moduleType) {
+        Map nameMap = new HashMap();
+        nameMap.put("name", name);
+        if (type != null) {
+            nameMap.put("j2eeType", type);
+        }
+        if (module != null) {
+            nameMap.put(moduleType, module);
+        }
+        return new AbstractNameQuery(configId, nameMap);
+    }
+
+    public static Class assureInterface(String interfaceName, String superInterfaceName, String interfaceType, ClassLoader cl) throws DeploymentException {
+        if (interfaceName == null || interfaceName.equals("")) {
+            throw new DeploymentException("interface name cannot be blank");
+        }
+        Class clazz;
+        try {
+            clazz = cl.loadClass(interfaceName);
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException(interfaceType + " interface class not found: " + interfaceName);
+        }
+        if (!clazz.isInterface()) {
+            throw new DeploymentException(interfaceType + " interface is not an interface: " + interfaceName);
+        }
+        Class superInterface;
+        try {
+            superInterface = cl.loadClass(superInterfaceName);
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException("Class " + superInterfaceName + " could not be loaded");
+        }
+        if (!superInterface.isAssignableFrom(clazz)) {
+            throw new DeploymentException(interfaceType + " interface does not extend " + superInterfaceName + ": " + interfaceName);
+        }
+        return clazz;
+    }
+
+
+}

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

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

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

Added: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/CorbaRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/CorbaRefBuilder.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/CorbaRefBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/CorbaRefBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,83 @@
+/**
+ *
+ * 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.naming.deployment;
+
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.CorbaGBeanNameSource;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.naming.reference.ORBReference;
+import org.apache.geronimo.naming.reference.HandleDelegateReference;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.SingleElementCollection;
+
+/**
+ * TODO consider if this should be in openejb-builder module or a hypothetical corba-builder module
+ * @version $Rev:$ $Date:$
+ */
+public class CorbaRefBuilder extends AbstractNamingBuilder {
+
+    private final SingleElementCollection corbaGBeanNameSourceCollection;
+
+    public CorbaRefBuilder(Collection corbaGBeanNameSource) {
+        this.corbaGBeanNameSourceCollection = new SingleElementCollection(corbaGBeanNameSource);
+    }
+
+    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+        CorbaGBeanNameSource corbaGBeanNameSource = (CorbaGBeanNameSource) corbaGBeanNameSourceCollection.getElement();
+        if (corbaGBeanNameSource != null) {
+            AbstractNameQuery corbaName = corbaGBeanNameSource.getCorbaGBeanName();
+            if (corbaName != null) {
+                Artifact moduleId = localConfiguration.getId();
+                componentContext.put("ORB", new ORBReference(moduleId, corbaName));
+                componentContext.put("HandleDelegate", new HandleDelegateReference(moduleId, corbaName));
+            }
+        }
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return QNameSet.EMPTY;
+    }
+
+    public QNameSet getPlanQNameSet() {
+        return QNameSet.EMPTY;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(CorbaRefBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("CorbaGBeanNameSource", CorbaGBeanNameSource.class);
+        infoBuilder.setConstructor(new String[] {"CorbaGBeanNameSource"});
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

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

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

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



Mime
View raw message