geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r442387 [2/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
Added: geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/main/java/org/apache/geronimo/connector/deployment/ResourceRefBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,187 @@
+/**
+ *
+ * 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.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.HashMap;
+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.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.j2ee.deployment.Module;
+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.GerPatternType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefDocument;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
+import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
+import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ResourceRefBuilder extends AbstractNamingBuilder {
+    private static final String J2EE_NAMESPACE = ConnectorDocument.type.getDocumentElementName().getNamespaceURI();
+    private static final QName RESOURCE_REF_QNAME = new QName(J2EE_NAMESPACE, "resource-ref");
+    private static final QNameSet RESOURCE_REF_QNAME_SET = QNameSet.singleton(RESOURCE_REF_QNAME);
+    private static final QName GER_RESOURCE_REF_QNAME = GerResourceRefDocument.type.getDocumentElementName();
+    private static final QNameSet GER_RESOURCE_REF_QNAME_SET = QNameSet.singleton(GER_RESOURCE_REF_QNAME);
+
+    private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";
+    private static final String JAVAX_MAIL_SESSION_CLASS = "javax.mail.Session";
+
+
+    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) {
+    }
+
+    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
+        XmlObject[] resourceRefsUntyped = specDD.selectChildren(RESOURCE_REF_QNAME_SET);
+        XmlObject[] gerResourceRefsUntyped = plan == null? NO_REFS: plan.selectChildren(GER_RESOURCE_REF_QNAME_SET);
+        Map refMap = mapResourceRefs(gerResourceRefsUntyped);
+        ClassLoader cl = localConfiguration.getConfigurationClassLoader();
+
+        for (int i = 0; i < resourceRefsUntyped.length; i++) {
+            ResourceRefType resourceRef = (ResourceRefType) resourceRefsUntyped[i];
+            String name = resourceRef.getResRefName().getStringValue().trim();
+            String type = resourceRef.getResType().getStringValue().trim();
+            GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(name);
+            Class iface;
+            try {
+                iface = cl.loadClass(type);
+            } catch (ClassNotFoundException e) {
+                throw new DeploymentException("could not load class " + type, e);
+            }
+            if (iface == URL.class) {
+                if (gerResourceRef == null || !gerResourceRef.isSetUrl()) {
+                    throw new DeploymentException("No url supplied to resolve: " + name);
+                }
+                try {
+                    //TODO expose jsr-77 objects for these guys
+                    componentContext.put(ENV + name, new URL(gerResourceRef.getUrl()));
+                } catch (MalformedURLException e) {
+                    throw new DeploymentException("Could not convert " + gerResourceRef.getUrl() + " to URL", e);
+                }
+            } else {
+                //determine jsr-77 type from interface
+                String j2eeType;
+
+
+                if (JAVAX_MAIL_SESSION_CLASS.equals(type)) {
+                    j2eeType = NameFactory.JAVA_MAIL_RESOURCE;
+                } else if (JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
+                    j2eeType = NameFactory.JAXR_CONNECTION_FACTORY;
+                } else {
+                    j2eeType = NameFactory.JCA_MANAGED_CONNECTION_FACTORY;
+                }
+                try {
+                    AbstractNameQuery containerId = getResourceContainerId(name, j2eeType, null, gerResourceRef);
+
+                    try {
+                        localConfiguration.findGBean(containerId);
+                    } catch (GBeanNotFoundException e) {
+                        throw new UnresolvedReferenceException("Resource", false, containerId.toString(), localConfiguration.getId().toString());
+                    }
+
+                    Reference ref = new ResourceReference(localConfiguration.getId(), containerId, iface);
+                    componentContext.put(ENV + name, ref);
+                } catch (UnresolvedReferenceException e) {
+
+                    StringBuffer errorMessage = new StringBuffer("Unable to resolve resource reference '");
+                    errorMessage.append(name);
+                    errorMessage.append("' (");
+                    if (e.isMultiple()) {
+                        errorMessage.append("Found multiple matching resources.  Try being more specific in a resource-ref mapping in your Geronimo deployment plan.");
+                    } else if (gerResourceRef == null) {
+                        errorMessage.append("Could not auto-map to resource.  Try adding a resource-ref mapping to your Geronimo deployment plan.");
+                    } else if (gerResourceRef.isSetResourceLink()) {
+                        errorMessage.append("Could not find resource '");
+                        errorMessage.append(gerResourceRef.getResourceLink());
+                        errorMessage.append("'.  Perhaps it has not yet been configured, or your application does not have a dependency declared for that resource module?");
+                    } else {
+                        errorMessage.append("Could not find the resource specified in your Geronimo deployment plan:");
+                        errorMessage.append(gerResourceRef.getPattern());
+                    }
+                    errorMessage.append(")");
+
+                    throw new DeploymentException(errorMessage.toString());
+                }
+            }
+        }
+
+    }
+
+    private Map mapResourceRefs(XmlObject[] refs) {
+        Map refMap = new HashMap();
+        if (refs != null) {
+            for (int i = 0; i < refs.length; i++) {
+                GerResourceRefType ref = (GerResourceRefType) refs[i].copy().changeType(GerResourceRefType.type);
+                refMap.put(ref.getRefName().trim(), ref);
+            }
+        }
+        return refMap;
+    }
+
+    private AbstractNameQuery getResourceContainerId(String name, String type, URI moduleURI, GerResourceRefType gerResourceRef) {
+        AbstractNameQuery containerId;
+        String module = moduleURI == null ? null : moduleURI.toString();
+        if (gerResourceRef == null) {
+            containerId = buildAbstractNameQuery(null, module, name, type, NameFactory.RESOURCE_ADAPTER_MODULE);
+        } else if (gerResourceRef.isSetResourceLink()) {
+            containerId = buildAbstractNameQuery(null, module, gerResourceRef.getResourceLink().trim(), type, NameFactory.RESOURCE_ADAPTER_MODULE);
+        } else {
+            //construct name from components
+            GerPatternType patternType = gerResourceRef.getPattern();
+            containerId = buildAbstractNameQuery(patternType, type, NameFactory.RESOURCE_ADAPTER_MODULE, null);
+        }
+        return containerId;
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return RESOURCE_REF_QNAME_SET;
+    }
+
+    public QNameSet getPlanQNameSet() {
+        return GER_RESOURCE_REF_QNAME_SET;
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(ResourceRefBuilder.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/ResourceRefBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

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

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Mon Sep 11 16:51:32 2006
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
-import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.sql.Connection;
@@ -36,9 +35,6 @@
 
 import javax.naming.Reference;
 import javax.sql.DataSource;
-import javax.xml.namespace.QName;
-
-import org.apache.geronimo.testsupport.TestSupport;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
@@ -50,14 +46,11 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.ActivationSpecInfoLocator;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 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.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.kernel.Jsr77Naming;
@@ -83,6 +76,7 @@
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.transaction.manager.GeronimoTransactionManagerGBean;
 import org.tranql.sql.jdbc.JDBCUtil;
 
@@ -113,24 +107,7 @@
         }
     };
 
-    private EJBReferenceBuilder ejbReferenceBuilder = 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;
-        }
-
-    };
-
-    private ResourceReferenceBuilder resourceReferenceBuilder = new ResourceReferenceBuilder() {
+    private ActivationSpecInfoLocator activationSpecInfoLocator = new ActivationSpecInfoLocator() {
 
         public Reference createResourceRef(AbstractNameQuery containerId, Class iface, Configuration configuration) {
             return null;
@@ -145,13 +122,6 @@
         }
     };
 
-    private ServiceReferenceBuilder serviceReferenceBuilder = 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;
-        }
-    };
-
     private Kernel kernel;
     private EditableConfigurationManager configurationManager;
     private static final Naming naming = new Jsr77Naming();
@@ -177,12 +147,10 @@
                     new AbstractNameQuery(serverName, J2EEServerImpl.GBEAN_INFO.getInterfaces()),
                     null,
                     null,
-                    ejbReferenceBuilder,
                     null,
                     new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, Collections.singleton(serviceBuilder)),
-                    resourceReferenceBuilder,
+                    activationSpecInfoLocator,
                     null,
-                    serviceReferenceBuilder,
                     null,
                     serviceBuilder,
                     kernel.getNaming());
@@ -391,8 +359,8 @@
                         connectionTrackerName,
                         null,
                         null,
-                        null,
-                        new RefContext(ejbReferenceBuilder, moduleBuilder, serviceReferenceBuilder));
+                        null
+                );
 
                 action.install(moduleBuilder, earContext, module, configurationStore);
                 earContext.getClassLoader();

Added: geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java (added)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/MessageDestinationTest.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,314 @@
+/**
+ *
+ * Copyright 2005 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.io.File;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.connector.AdminObjectWrapperGBean;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.j2ee.deployment.ConnectorModule;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.Jsr77Naming;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
+import org.apache.geronimo.kernel.config.ConfigurationManager;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationResolver;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.LifecycleException;
+import org.apache.geronimo.kernel.config.LifecycleMonitor;
+import org.apache.geronimo.kernel.config.LifecycleResults;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.NoSuchStoreException;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Version;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:390932 $ $Date$
+ */
+public class MessageDestinationTest extends TestCase {
+
+    private static final Naming naming = new Jsr77Naming();
+    Configuration configuration;
+    AbstractName baseName;
+    AdminObjectRefBuilder adminObjectRefBuilder = new AdminObjectRefBuilder();
+    Module module;
+
+    Map componentContext = new HashMap();
+
+    protected void setUp() throws Exception {
+        super.setUp();
+        Artifact id = new Artifact("test", "test", "", "car");
+        configuration = new Configuration(Collections.EMPTY_LIST,
+                new ConfigurationData(id, naming),
+                new ConfigurationResolver(id, null),
+                null);
+        module  = new ConnectorModule(false, new AbstractName(id, Collections.singletonMap("name", "test")), null, null, "foo", null, null, null);
+        EARContext earContext = new EARContext(new File("foo"), null, new Environment(new Artifact("foo", "bar", "1.0", "car")), ConfigurationModuleType.EAR, naming,
+                new ConfigurationManager() {
+                    public boolean isInstalled(Artifact configurationId) {
+                        return false;
+                    }
+
+                    public Artifact[] getInstalled(Artifact query) {
+                        return new Artifact[0];
+                    }
+
+                    public Artifact[] getLoaded(Artifact query) {
+                        return new Artifact[0];
+                    }
+
+                    public Artifact[] getRunning(Artifact query) {
+                        return new Artifact[0];
+                    }
+
+                    public boolean isLoaded(Artifact configID) {
+                        return false;
+                    }
+
+                    public List listStores() {
+                        return Collections.EMPTY_LIST;
+                    }
+
+                    public ConfigurationStore[] getStores() {
+                        return new ConfigurationStore[0];
+                    }
+
+                    public ConfigurationStore getStoreForConfiguration(Artifact configuration) {
+                        return null;
+                    }
+
+                    public List listConfigurations(AbstractName store) throws NoSuchStoreException {
+                        return Collections.EMPTY_LIST;
+                    }
+
+                    public boolean isRunning(Artifact configurationId) {
+                        return false;
+                    }
+
+                    public List listConfigurations() {
+                        return null;
+                    }
+
+                    public boolean isConfiguration(Artifact artifact) {
+                        return false;
+                    }
+
+                    public Configuration getConfiguration(Artifact configurationId) {
+                        return null;
+                    }
+
+                    public LifecycleResults loadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults loadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults loadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults loadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults unloadConfiguration(Artifact configurationId) throws NoSuchConfigException {
+                        return null;
+                    }
+
+                    public LifecycleResults unloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
+                        return null;
+                    }
+
+                    public LifecycleResults startConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults startConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults stopConfiguration(Artifact configurationId) throws NoSuchConfigException {
+                        return null;
+                    }
+
+                    public LifecycleResults stopConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException {
+                        return null;
+                    }
+
+                    public LifecycleResults restartConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults restartConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(Artifact configurationId) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(Artifact configurationId, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(Artifact configurationId, Version version) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(Artifact configurationId, Version version, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(ConfigurationData configurationData) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public LifecycleResults reloadConfiguration(ConfigurationData configurationData, LifecycleMonitor monitor) throws NoSuchConfigException, LifecycleException {
+                        return null;
+                    }
+
+                    public void uninstallConfiguration(Artifact configurationId) throws IOException, NoSuchConfigException {
+
+                    }
+
+                    public ArtifactResolver getArtifactResolver() {
+                        return null;
+                    }
+
+                    public boolean isOnline() {
+                        return true;
+                    }
+
+                    public void setOnline(boolean online) {
+                    }
+
+                }, null, null, null, null, null, null, null, null);
+        module.setEarContext(earContext);
+        module.setRootEarContext(earContext);
+        baseName = naming.createRootName(configuration.getId(), "testRoot", NameFactory.RESOURCE_ADAPTER_MODULE);
+    }
+
+    private static final String SPECDD1 = "<tmp xmlns=\"http://java.sun.com/xml/ns/j2ee\">" +
+            "<message-destination><message-destination-name>d1</message-destination-name></message-destination>" +
+            "<message-destination><message-destination-name>d2</message-destination-name></message-destination>" +
+            "<message-destination-ref>" +
+            "  <message-destination-ref-name>n1</message-destination-ref-name>" +
+            "  <message-destination-type>java.lang.Object</message-destination-type>" +
+            "  <message-destination-link>d1</message-destination-link>" +
+            "</message-destination-ref>" +
+            "<message-destination-ref>" +
+            "  <message-destination-ref-name>n2</message-destination-ref-name>" +
+            "  <message-destination-type>java.lang.Object</message-destination-type>" +
+            "  <message-destination-link>d2</message-destination-link>" +
+            "</message-destination-ref>" +
+            "</tmp>";
+
+    private static final String PLAN1 = "<tmp xmlns=\"http://geronimo.apache.org/xml/ns/naming-1.2\">" +
+            "<message-destination>" +
+            "  <message-destination-name>d1</message-destination-name>" +
+            "  <admin-object-link>l1</admin-object-link>" +
+            "</message-destination>" +
+            "<message-destination>" +
+            "  <message-destination-name>d2</message-destination-name>" +
+            "  <admin-object-link>l2</admin-object-link>" +
+            "</message-destination>" +
+            "</tmp>";
+
+    public void testMessageDestinations() throws Exception {
+        XmlObject specDD = parse(SPECDD1);
+        XmlObject plan = parse(PLAN1);
+        adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+        AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
+        AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
+        configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
+        configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
+        adminObjectRefBuilder.buildNaming(specDD, plan, configuration, configuration, module, componentContext);
+        assertEquals(2, componentContext.size());
+    }
+
+    private static final String PLAN2 = "<tmp xmlns=\"http://geronimo.apache.org/xml/ns/naming-1.2\">" +
+            "<message-destination>" +
+            "  <message-destination-name>d1</message-destination-name>" +
+            "  <admin-object-module>testRoot</admin-object-module>" +
+            "  <admin-object-link>l1</admin-object-link>" +
+            "</message-destination>" +
+            "<message-destination>" +
+            "  <message-destination-name>d2</message-destination-name>" +
+            "  <admin-object-module>testRoot</admin-object-module>" +
+            "  <admin-object-link>l2</admin-object-link>" +
+            "</message-destination>" +
+            "</tmp>";
+    public void testMessageDestinationsWithModule() throws Exception {
+        XmlObject specDD = parse(SPECDD1);
+        XmlObject plan = parse(PLAN2);
+        adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+        AbstractName n1 = naming.createChildName(baseName, "l1", NameFactory.JCA_ADMIN_OBJECT);
+        AbstractName n2 = naming.createChildName(baseName, "l2", NameFactory.JCA_ADMIN_OBJECT);
+        configuration.addGBean(new GBeanData(n1, AdminObjectWrapperGBean.GBEAN_INFO));
+        configuration.addGBean(new GBeanData(n2, AdminObjectWrapperGBean.GBEAN_INFO));
+        adminObjectRefBuilder.buildNaming(specDD, plan, configuration, configuration, module, componentContext);
+        assertEquals(2, componentContext.size());
+    }
+
+    private static final String SPECDD2 = "<tmp xmlns=\"http://java.sun.com/xml/ns/j2ee\">" +
+            "</tmp>";
+
+
+    public void testMessageDestinationsMatch() throws Exception {
+        XmlObject specDD = parse(SPECDD2);
+        XmlObject plan = parse(PLAN1);
+        try {
+            adminObjectRefBuilder.initContext(specDD, plan, configuration, configuration, module);
+            fail("tried to register a GerMessageDestination witout a MessageDestination and it succeeded");
+        } catch (DeploymentException e) {
+
+        }
+    }
+
+    private XmlObject parse(String xmlString) throws XmlException {
+        XmlObject xmlObject = XmlObject.Factory.parse(xmlString);
+        XmlCursor xmlCursor = xmlObject.newCursor();
+        try {
+            xmlCursor.toFirstChild();
+            return xmlCursor.getObject();
+        } finally {
+            xmlCursor.dispose();
+        }
+    }
+
+
+}
+

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java (original)
+++ geronimo/server/trunk/modules/geronimo-connector-builder/src/test/java/org/apache/geronimo/connector/deployment/PlanParsingTest.java Mon Sep 11 16:51:32 2006
@@ -1,17 +1,15 @@
 package org.apache.geronimo.connector.deployment;
 
-import java.io.File;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
 
-import org.apache.geronimo.testsupport.TestSupport;
-
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorType;
 import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ActivationSpecInfoLocator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ActivationSpecInfoLocator.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ActivationSpecInfoLocator.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ActivationSpecInfoLocator.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,30 @@
+/**
+ *
+ * Copyright 2004 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.j2ee.deployment;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.kernel.config.Configuration;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public interface ActivationSpecInfoLocator {
+
+    GBeanData locateActivationSpecInfo(AbstractNameQuery nameQuery, String messageListenerInterface, Configuration configuration) throws DeploymentException;
+
+}

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

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

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

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/CorbaGBeanNameSource.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/CorbaGBeanNameSource.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/CorbaGBeanNameSource.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/CorbaGBeanNameSource.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,27 @@
+/**
+ *
+ * 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.j2ee.deployment;
+
+import org.apache.geronimo.gbean.AbstractNameQuery;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface CorbaGBeanNameSource {
+    AbstractNameQuery getCorbaGBeanName();
+}

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Mon Sep 11 16:51:32 2006
@@ -36,6 +36,7 @@
 import java.util.Set;
 import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
+
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
@@ -51,7 +52,6 @@
 import org.apache.geronimo.deployment.util.NestedJarFile;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
 import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xbeans.ServiceDocument;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
@@ -84,7 +84,6 @@
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerApplicationType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerExtModuleType;
 import org.apache.geronimo.xbeans.geronimo.j2ee.GerModuleType;
-import org.apache.geronimo.xbeans.geronimo.j2ee.GerSecurityDocument;
 import org.apache.geronimo.xbeans.j2ee.ApplicationType;
 import org.apache.geronimo.xbeans.j2ee.ModuleType;
 import org.apache.xmlbeans.XmlException;
@@ -93,14 +92,12 @@
 /**
  * @version $Rev$ $Date$
  */
-public class EARConfigBuilder implements ConfigurationBuilder {
+public class EARConfigBuilder implements ConfigurationBuilder, CorbaGBeanNameSource {
 
     private static final Log log = LogFactory.getLog(EARConfigBuilder.class);
     private static final String LINE_SEP = System.getProperty("line.separator");
 
     private final static QName APPLICATION_QNAME = GerApplicationDocument.type.getDocumentElementName();
-    private static final QName SECURITY_QNAME = GerSecurityDocument.type.getDocumentElementName();
-    private static final QName SERVICE_QNAME = ServiceDocument.type.getDocumentElementName();
 
     private final ConfigurationManager configurationManager;
     private final Collection repositories;
@@ -108,9 +105,7 @@
     private final SingleElementCollection webConfigBuilder;
     private final SingleElementCollection connectorConfigBuilder;
     private final SingleElementCollection appClientConfigBuilder;
-    private final SingleElementCollection ejbReferenceBuilder;
     private final SingleElementCollection resourceReferenceBuilder;
-    private final SingleElementCollection serviceReferenceBuilder;
     private final NamespaceDrivenBuilderCollection securityBuilders;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
 
@@ -132,12 +127,10 @@
             AbstractNameQuery serverName,
             Collection repositories,
             Collection ejbConfigBuilder,
-            Collection ejbReferenceBuilder,
             Collection webConfigBuilder,
             Collection connectorConfigBuilder,
             Collection resourceReferenceBuilder,
             Collection appClientConfigBuilder,
-            Collection serviceReferenceBuilder,
             Collection securityBuilders,
             Collection serviceBuilders,
             Kernel kernel) {
@@ -151,12 +144,10 @@
                 ConfigurationUtil.getConfigurationManager(kernel),
                 repositories,
                 new SingleElementCollection(ejbConfigBuilder),
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(webConfigBuilder),
                 new SingleElementCollection(connectorConfigBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
                 new SingleElementCollection(appClientConfigBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 securityBuilders,
                 serviceBuilders,
                 kernel.getNaming());
@@ -170,12 +161,10 @@
             AbstractNameQuery serverName,
             Collection repositories,
             ModuleBuilder ejbConfigBuilder,
-            EJBReferenceBuilder ejbReferenceBuilder,
             ModuleBuilder webConfigBuilder,
             ModuleBuilder connectorConfigBuilder,
-            ResourceReferenceBuilder resourceReferenceBuilder,
+            ActivationSpecInfoLocator activationSpecInfoLocator,
             ModuleBuilder appClientConfigBuilder,
-            ServiceReferenceBuilder serviceReferenceBuilder,
             NamespaceDrivenBuilder securityBuilder,
             NamespaceDrivenBuilder serviceBuilder,
             Naming naming) {
@@ -189,12 +178,10 @@
                 null,
                 repositories,
                 new SingleElementCollection(ejbConfigBuilder),
-                new SingleElementCollection(ejbReferenceBuilder),
                 new SingleElementCollection(webConfigBuilder),
                 new SingleElementCollection(connectorConfigBuilder),
-                new SingleElementCollection(resourceReferenceBuilder),
+                new SingleElementCollection(activationSpecInfoLocator),
                 new SingleElementCollection(appClientConfigBuilder),
-                new SingleElementCollection(serviceReferenceBuilder),
                 securityBuilder == null? Collections.EMPTY_SET: Collections.singleton(securityBuilder),
                 serviceBuilder == null? Collections.EMPTY_SET: Collections.singleton(serviceBuilder),
                 naming);
@@ -210,25 +197,22 @@
             ConfigurationManager configurationManager,
             Collection repositories,
             SingleElementCollection ejbConfigBuilder,
-            SingleElementCollection ejbReferenceBuilder,
             SingleElementCollection webConfigBuilder,
             SingleElementCollection connectorConfigBuilder,
             SingleElementCollection resourceReferenceBuilder,
             SingleElementCollection appClientConfigBuilder,
-            SingleElementCollection serviceReferenceBuilder,
             Collection securityBuilders,
-            Collection serviceBuilders, Naming naming) {
+            Collection serviceBuilders,
+            Naming naming) {
         this.configurationManager = configurationManager;
         this.repositories = repositories;
         this.defaultEnvironment = defaultEnvironment;
 
         this.ejbConfigBuilder = ejbConfigBuilder;
-        this.ejbReferenceBuilder = ejbReferenceBuilder;
         this.resourceReferenceBuilder = resourceReferenceBuilder;
         this.webConfigBuilder = webConfigBuilder;
         this.connectorConfigBuilder = connectorConfigBuilder;
         this.appClientConfigBuilder = appClientConfigBuilder;
-        this.serviceReferenceBuilder = serviceReferenceBuilder;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders);
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
 
@@ -241,6 +225,11 @@
         this.naming = naming;
     }
 
+
+    public AbstractNameQuery getCorbaGBeanName() {
+        return corbaGBeanObjectName;
+    }
+
     private ModuleBuilder getEjbConfigBuilder() {
         return (ModuleBuilder) ejbConfigBuilder.getElement();
     }
@@ -257,16 +246,8 @@
         return (ModuleBuilder) appClientConfigBuilder.getElement();
     }
 
-    private EJBReferenceBuilder getEjbReferenceBuilder() {
-        return (EJBReferenceBuilder) ejbReferenceBuilder.getElement();
-    }
-
-    private ResourceReferenceBuilder getResourceReferenceBuilder() {
-        return (ResourceReferenceBuilder) resourceReferenceBuilder.getElement();
-    }
-
-    private ServiceReferenceBuilder getServiceReferenceBuilder() {
-        return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
+    private ActivationSpecInfoLocator getResourceReferenceBuilder() {
+        return (ActivationSpecInfoLocator) resourceReferenceBuilder.getElement();
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile, ModuleIDBuilder idBuilder) throws DeploymentException {
@@ -472,8 +453,8 @@
                     connectionTrackerObjectName,
                     transactionalTimerObjectName,
                     nonTransactionalTimerObjectName,
-                    corbaGBeanObjectName,
-                    new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(), getServiceReferenceBuilder()));
+                    corbaGBeanObjectName
+            );
 
             // Copy over all files that are _NOT_ modules (e.g. META-INF and APP-INF files)
             Set moduleLocations = applicationInfo.getModuleLocations();
@@ -921,12 +902,10 @@
 
         infoBuilder.addReference("Repositories", Repository.class, "Repository");
         infoBuilder.addReference("EJBConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("EJBReferenceBuilder", EJBReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("WebConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ConnectorConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ActivationSpecInfoLocator", ActivationSpecInfoLocator.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("AppClientConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
-        infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
 
@@ -944,12 +923,10 @@
                 "serverName",
                 "Repositories",
                 "EJBConfigBuilder",
-                "EJBReferenceBuilder",
                 "WebConfigBuilder",
                 "ConnectorConfigBuilder",
-                "ResourceReferenceBuilder",
+                "ActivationSpecInfoLocator",
                 "AppClientConfigBuilder",
-                "ServiceReferenceBuilder",
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "kernel"

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARContext.java Mon Sep 11 16:51:32 2006
@@ -34,21 +34,20 @@
  * @version $Rev:386276 $ $Date$
  */
 public class EARContext extends DeploymentContext {
+
+    private final AbstractNameQuery serverName;
     private final AbstractNameQuery transactionManagerObjectName;
     private final AbstractNameQuery connectionTrackerObjectName;
-
     private final AbstractNameQuery transactedTimerName;
     private final AbstractNameQuery nonTransactedTimerName;
-
     private final AbstractNameQuery corbaGBeanObjectName;
 
-    private final RefContext refContext;
-    private final AbstractNameQuery serverName;
-
     private final Map contextIDToPermissionsMap = new HashMap();
     private AbstractName jaccManagerName;
     private Object securityConfiguration;
 
+    private final Map  messageDestinations = new HashMap();
+
     public EARContext(File baseDir,
             File inPlaceConfigurationDir,
             Environment environment,
@@ -61,8 +60,8 @@
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery transactedTimerName,
             AbstractNameQuery nonTransactedTimerName,
-            AbstractNameQuery corbaGBeanObjectName,
-            RefContext refContext) throws DeploymentException {
+            AbstractNameQuery corbaGBeanObjectName
+    ) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager, repositories);
 
         this.serverName = serverName;
@@ -71,7 +70,6 @@
         this.transactedTimerName = transactedTimerName;
         this.nonTransactedTimerName = nonTransactedTimerName;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
-        this.refContext = refContext;
     }
 
     public EARContext(File baseDir,
@@ -86,8 +84,8 @@
             AbstractNameQuery connectionTrackerObjectName,
             AbstractNameQuery transactedTimerName,
             AbstractNameQuery nonTransactedTimerName,
-            AbstractNameQuery corbaGBeanObjectName,
-            RefContext refContext) throws DeploymentException {
+            AbstractNameQuery corbaGBeanObjectName
+    ) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, naming, configurationManager);
 
         this.serverName = serverName;
@@ -97,30 +95,28 @@
         this.transactedTimerName = transactedTimerName;
         this.nonTransactedTimerName = nonTransactedTimerName;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
-        this.refContext = refContext;
     }
 
     public EARContext(File baseDir, File inPlaceConfigurationDir, Environment environment, ConfigurationModuleType moduleType, AbstractName baseName, EARContext parent) throws DeploymentException {
         super(baseDir, inPlaceConfigurationDir, environment, baseName, moduleType, parent.getNaming(), parent.getConfigurationManager());
         this.serverName = parent.getServerName();
 
-        this.transactionManagerObjectName = parent.getTransactionManagerObjectName();
-        this.connectionTrackerObjectName = parent.getConnectionTrackerObjectName();
+        this.transactionManagerObjectName = parent.getTransactionManagerName();
+        this.connectionTrackerObjectName = parent.getConnectionTrackerName();
         this.transactedTimerName = parent.getTransactedTimerName();
         this.nonTransactedTimerName = parent.getNonTransactedTimerName();
-        this.corbaGBeanObjectName = parent.getCORBAGBeanObjectName();
-        this.refContext = parent.getRefContext();
+        this.corbaGBeanObjectName = parent.getCORBAGBeanName();
     }
 
     public AbstractNameQuery getServerName() {
         return serverName;
     }
 
-    public AbstractNameQuery getTransactionManagerObjectName() {
+    public AbstractNameQuery getTransactionManagerName() {
         return transactionManagerObjectName;
     }
 
-    public AbstractNameQuery getConnectionTrackerObjectName() {
+    public AbstractNameQuery getConnectionTrackerName() {
         return connectionTrackerObjectName;
     }
 
@@ -132,14 +128,10 @@
         return nonTransactedTimerName;
     }
 
-    public AbstractNameQuery getCORBAGBeanObjectName() {
+    public AbstractNameQuery getCORBAGBeanName() {
         return corbaGBeanObjectName;
     }
 
-    public RefContext getRefContext() {
-        return refContext;
-    }
-
     public Map getContextIDToPermissionsMap() {
         return contextIDToPermissionsMap;
     }
@@ -169,4 +161,13 @@
     public Object getSecurityConfiguration() {
         return securityConfiguration;
     }
+
+    public void registerMessageDestionations(String moduleName, Map nameMap) throws DeploymentException {
+        messageDestinations.put(moduleName, nameMap);
+    }
+
+    public Map getMessageDestinations() {
+        return messageDestinations;
+    }
+
 }

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/HandlerInfoInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/HandlerInfoInfo.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/HandlerInfoInfo.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/HandlerInfoInfo.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,62 @@
+/**
+ *
+ * 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.j2ee.deployment;
+
+import java.util.Set;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class HandlerInfoInfo {
+    private final Set portNames;
+    private final Class handlerClass;
+    private final Map handlerConfig;
+    private final QName[] soapHeaders;
+    private final Set soapRoles;
+
+    public HandlerInfoInfo(Set portNames, Class handlerClass, Map handlerConfig, QName[] soapHeaders, Set soapRoles) {
+        this.portNames = portNames;
+        this.handlerClass = handlerClass;
+        this.handlerConfig = handlerConfig;
+        this.soapHeaders = soapHeaders;
+        this.soapRoles = soapRoles;
+    }
+
+    public Set getPortNames() {
+        return portNames;
+    }
+
+    public Class getHandlerClass() {
+        return handlerClass;
+    }
+
+    public Map getHandlerConfig() {
+        return handlerConfig;
+    }
+
+    public QName[] getSoapHeaders() {
+        return soapHeaders;
+    }
+
+    public Set getSoapRoles() {
+        return soapRoles;
+    }
+}

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/Module.java Mon Sep 11 16:51:32 2006
@@ -18,15 +18,11 @@
 
 import java.util.jar.JarFile;
 import java.net.URI;
-import java.net.URISyntaxException;
-import java.io.IOException;
-import java.io.File;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
-import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.AbstractName;
 
 /**
@@ -48,8 +44,7 @@
     private final String namespace;
 
     private EARContext earContext;
-
-    private URI uniqueModuleLocation;
+    private EARContext rootEarContext;
 
     protected Module(boolean standAlone, AbstractName moduleName, Environment environment, JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String originalSpecDD, String namespace) {
         assert targetPath != null: "targetPath is null";
@@ -145,54 +140,6 @@
         DeploymentUtil.close(moduleFile);
     }
 
-    public void addClass(String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {
-        URI location = getUniqueModuleLocation(context);
-        addClass(location, fqcn, bytes, context);
-    }
-
-    private URI getUniqueModuleLocation(DeploymentContext context) throws IOException {
-        if (uniqueModuleLocation == null) {
-            URI metainfUri = URI.create("META-INF/");
-            File metainfDir = context.getTargetFile(metainfUri);
-            if (!metainfDir.exists()) {
-                metainfDir.mkdirs();
-            }
-            if (!metainfDir.isDirectory()) {
-                throw new IOException("META-INF directory exists but is not a directory: " + metainfDir.getAbsolutePath());
-            }
-            if (!metainfDir.canRead()) {
-                throw new IOException("META-INF directory is not readable: " + metainfDir.getAbsolutePath());
-            }
-            if (!metainfDir.canWrite()) {
-                throw new IOException("META-INF directory is not writable: " + metainfDir.getAbsolutePath());
-            }
-
-            String suffix = "";
-            URI generatedUri;
-            File generatedDir;
-            int i = 0;
-            do {
-                generatedUri = metainfUri.resolve("geronimo-generated" + suffix + "/");
-                generatedDir = context.getTargetFile(generatedUri);
-                suffix = "" + i++;
-            } while (generatedDir.exists());
-            generatedDir.mkdirs();
-
-            // these shouldn't ever happen, but let's check anyway
-            if (!generatedDir.isDirectory()) {
-                throw new IOException("Geronimo generated classes directory exists but is not a directory: " + generatedDir.getAbsolutePath());
-            }
-            if (!generatedDir.canRead()) {
-                throw new IOException("Geronimo generated classes directory is not readable: " + generatedDir.getAbsolutePath());
-            }
-            if (!generatedDir.canWrite()) {
-                throw new IOException("Geronimo generated classes directory is not writable: " + generatedDir.getAbsolutePath());
-            }
-
-            uniqueModuleLocation = generatedUri;
-        }
-        return uniqueModuleLocation;
-    }
 
     public EARContext getEarContext() {
         return earContext;
@@ -202,5 +149,11 @@
         this.earContext = earContext;
     }
 
-    public abstract void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException;
+    public EARContext getRootEarContext() {
+        return rootEarContext;
+    }
+
+    public void setRootEarContext(EARContext rootEarContext) {
+        this.rootEarContext = rootEarContext;
+    }
 }

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilder.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,45 @@
+/**
+ *
+ * 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.j2ee.deployment;
+
+import java.util.Map;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public interface NamingBuilder {
+
+    XmlObject[] NO_REFS = new XmlObject[] {};
+    String ENV = "env/";
+
+    void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) throws DeploymentException;
+
+    void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException;
+    
+    void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException;
+
+    QNameSet getSpecQNameSet();
+
+    QNameSet getPlanQNameSet();
+}

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

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

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

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,116 @@
+/**
+ *
+ * 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.j2ee.deployment;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Collections;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.gbean.ReferenceCollection;
+import org.apache.geronimo.gbean.ReferenceCollectionEvent;
+import org.apache.geronimo.gbean.ReferenceCollectionListener;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.xmlbeans.QNameSet;
+import org.apache.xmlbeans.XmlObject;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class NamingBuilderCollection implements NamingBuilder {
+
+    private final Collection builders;
+    private final QName basePlanElementName;
+    private QNameSet specQNames = QNameSet.EMPTY;
+    private QNameSet planQNames = QNameSet.EMPTY;
+
+    public NamingBuilderCollection(Collection builders, final QName basePlanElementName) {
+        this.builders = builders == null? Collections.EMPTY_SET: builders;
+        this.basePlanElementName = basePlanElementName;
+        if (builders instanceof ReferenceCollection) {
+            ((ReferenceCollection)builders).addReferenceCollectionListener(new ReferenceCollectionListener() {
+
+                public void memberAdded(ReferenceCollectionEvent event) {
+                    addBuilder(event.getMember());
+                }
+
+                public void memberRemoved(ReferenceCollectionEvent event) {
+                    Object builder = event.getMember();
+                    QNameSet builderSpecQNames = ((NamingBuilder)builder).getSpecQNameSet();
+                    specQNames = specQNames.intersect(builderSpecQNames.inverse());
+                    QNameSet builderPlanQNames = ((NamingBuilder)builder).getPlanQNameSet();
+                    planQNames = planQNames.intersect(builderPlanQNames.inverse());
+                    XmlBeansUtil.unregisterSubstitutionGroupElements(basePlanElementName, builderPlanQNames);
+                }
+            });
+        }
+        for (Iterator iterator = this.builders.iterator(); iterator.hasNext();) {
+            Object builder = iterator.next();
+            addBuilder(builder);
+        }
+    }
+
+    private void addBuilder(Object builder) {
+        QNameSet builderSpecQNames = ((NamingBuilder)builder).getSpecQNameSet();
+        if (!specQNames.isDisjoint(builderSpecQNames)) {
+            throw new IllegalArgumentException("Duplicate builderSpecQNames in builder set: " + builderSpecQNames);
+        }
+        specQNames = specQNames.union(builderSpecQNames);
+        QNameSet builderPlanQNames = ((NamingBuilder)builder).getPlanQNameSet();
+        if (!planQNames.isDisjoint(builderPlanQNames)) {
+            throw new IllegalArgumentException("Duplicate builderPlanQNames in builder set: " + builderPlanQNames);
+        }
+        planQNames = planQNames.union(builderPlanQNames);
+        //really?
+        XmlBeansUtil.registerSubstitutionGroupElements(basePlanElementName, builderPlanQNames);
+    }
+
+    public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment) throws DeploymentException {
+        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
+            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
+            namingBuilder.buildEnvironment(specDD, plan, environment);
+        }
+    }
+
+    public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
+        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
+            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
+            namingBuilder.initContext(specDD, plan, localConfiguration, remoteConfiguration, module);
+        }
+    }
+
+    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localContext, Configuration remoteContext, Module module, Map componentContext) throws DeploymentException {
+        for (Iterator iterator = builders.iterator(); iterator.hasNext();) {
+            NamingBuilder namingBuilder = (NamingBuilder) iterator.next();
+            namingBuilder.buildNaming(specDD, plan, localContext, remoteContext, module, componentContext);
+        }
+    }
+
+    public QNameSet getSpecQNameSet() {
+        return specQNames;
+    }
+
+    public QNameSet getPlanQNameSet() {
+        return null;
+    }
+}

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

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

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

Added: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionGBean.java?view=auto&rev=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollectionGBean.java Mon Sep 11 16:51:32 2006
@@ -0,0 +1,53 @@
+/**
+ *
+ * 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.j2ee.deployment;
+
+import java.util.Collection;
+
+import javax.xml.namespace.QName;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class NamingBuilderCollectionGBean extends NamingBuilderCollection {
+    public NamingBuilderCollectionGBean(Collection builders, String baseElementQNameNamespaceURI, String baseElementQNameLocalPart) {
+        super(builders, new QName(baseElementQNameNamespaceURI, baseElementQNameLocalPart));
+    }
+
+    static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(NamingBuilderCollectionGBean.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("baseElementQNameNamespaceURI", String.class, true, true);
+        infoBuilder.addAttribute("baseElementQNameLocalPart", String.class, true, true);
+        infoBuilder.addReference("NamingBuilders", NamingBuilder.class);
+
+        infoBuilder.setConstructor(new String[] {"NamingBuilders", "baseElementQNameNamespaceURI", "baseElementQNameLocalPart"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+

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

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

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

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/WebModule.java Mon Sep 11 16:51:32 2006
@@ -53,14 +53,5 @@
         return portMap;
     }
 
-    //TODO configid check all modules can use this form.    Remove if!
-    public void addClass(URI location, String fqcn, byte[] bytes, DeploymentContext context) throws IOException, URISyntaxException {
-        if (getEarContext() != null) {
-            getEarContext().addClass(location, fqcn, bytes);
-        } else {
-            context.addClass(location, fqcn, bytes);
-        }
-    }
-
 }
 

Modified: geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java?view=diff&rev=442387&r1=442386&r2=442387
==============================================================================
--- geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java (original)
+++ geronimo/server/trunk/modules/geronimo-j2ee-builder/src/test/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTestSupport.java Mon Sep 11 16:51:32 2006
@@ -19,6 +19,11 @@
 
 package org.apache.geronimo.j2ee.deployment;
 
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+import java.util.jar.JarFile;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
@@ -40,14 +45,6 @@
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.testsupport.TestSupport;
 
-import javax.xml.namespace.QName;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.jar.JarFile;
-
 /**
  * Provides support for EAR config builder tests.
  *
@@ -72,19 +69,12 @@
     
     protected static MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
     
-    protected static ResourceReferenceBuilder resourceReferenceBuilder = connectorConfigBuilder;
+    protected static ActivationSpecInfoLocator activationSpecInfoLocator = connectorConfigBuilder;
     
     protected static ModuleBuilder appClientConfigBuilder = null;
     
     protected final static ModuleIDBuilder idBuilder = new ModuleIDBuilder();
     
-    protected static ServiceReferenceBuilder serviceReferenceBuilder = 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;
-        }
-    };
-
     protected static final NamespaceDrivenBuilder securityBuilder = null;
     
     protected static final NamespaceDrivenBuilder serviceBuilder = null;
@@ -147,12 +137,10 @@
                     null,
                     null,
                     ejbConfigBuilder,
-                    ejbConfigBuilder,
                     webConfigBuilder,
                     connectorConfigBuilder,
-                    resourceReferenceBuilder,
+                    activationSpecInfoLocator,
                     appClientConfigBuilder,
-                    serviceReferenceBuilder,
                     securityBuilder,
                     serviceBuilder,
                     naming);
@@ -180,12 +168,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -221,12 +207,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -262,12 +246,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -303,12 +285,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -344,12 +324,10 @@
                 null,
                 null,
                 null,
-                null,
                 webConfigBuilder,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -384,12 +362,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                ejbConfigBuilder,
                 null,
                 connectorConfigBuilder,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);
@@ -423,12 +399,10 @@
                 null,
                 null,
                 ejbConfigBuilder,
-                null,
                 webConfigBuilder,
                 null,
-                resourceReferenceBuilder,
+                activationSpecInfoLocator,
                 appClientConfigBuilder,
-                serviceReferenceBuilder,
                 securityBuilder,
                 serviceBuilder,
                 naming);



Mime
View raw message