geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1132900 - in /geronimo/server/trunk/plugins: client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/ j2ee/geronim...
Date Tue, 07 Jun 2011 08:13:55 GMT
Author: genspring
Date: Tue Jun  7 08:13:55 2011
New Revision: 1132900

URL: http://svn.apache.org/viewvc?rev=1132900&view=rev
Log:
re-enable the message-destination handling logic for spec and vendor DD.

Modified:
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
    geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Tue Jun  7 08:13:55 2011
@@ -711,7 +711,11 @@ public class AppClientModuleBuilder impl
                 break;
             }
         }
-
+        
+        //Share the messageDestination info with the ear
+        if (appClientDeploymentContext.getMessageDestinations() != null && earContext.getMessageDestinations()
!= null) {
+            appClientDeploymentContext.getMessageDestinations().putAll(earContext.getMessageDestinations());
+        }
 
         try {
             try {

Modified: geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/connector-1_6/geronimo-connector-builder-1_6/src/main/java/org/apache/geronimo/connector/deployment/AdminObjectRefBuilder.java
Tue Jun  7 08:13:55 2011
@@ -101,10 +101,11 @@ public class AdminObjectRefBuilder exten
     }
 
     public void initContext(JndiConsumer specDD, XmlObject plan, Module module) throws DeploymentException
{
-        List<MessageDestination> specDestinations;
+        Collection<MessageDestination> specDestinations;
         try {
             Method m = specDD.getClass().getMethod("getMessageDestination", new Class[0]);
-            specDestinations = (List<MessageDestination>) m.invoke(specDD, new Object[0]);
+            m.setAccessible(true);
+            specDestinations = (Collection<MessageDestination>) m.invoke(specDD, new
Object[0]);
         } catch (Exception e) {
             specDestinations = new ArrayList<MessageDestination>();
         }
@@ -125,7 +126,7 @@ public class AdminObjectRefBuilder exten
                 throw new DeploymentException("No spec DD message-destination for " + name);
             }
         }
-        module.getRootEarContext().registerMessageDestionations(module.getName(), nameMap);
+        module.getRootEarContext().registerMessageDestionations(module.getModuleURI().toString(),
nameMap);
     }
 
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverter.java
Tue Jun  7 08:13:55 2011
@@ -56,6 +56,7 @@ public class GenericToSpecificPlanConver
         this.namespace = namespace;
         this.element = element;
         excludedNamespaces.add("http://geronimo.apache.org/xml/ns/geronimo-jaspi");
+        excludedNamespaces.add("http://openejb.apache.org/xml/ns/openejb-jar-2.3");
     }
 
     public XmlObject convertToSpecificPlan(XmlObject plan) throws DeploymentException {
@@ -96,9 +97,9 @@ public class GenericToSpecificPlanConver
                     cursor.push();
                     while (cursor.hasNextToken()) {
                         if (cursor.isStart()) {
-                            if (!SchemaConversionUtils.convertSingleElementToGeronimoSubSchemas(cursor,
end)
-                            && !this.namespace.equals(cursor.getName().getNamespaceURI())
-                                    && !excludedNamespaces.contains(cursor.getName().getNamespaceURI()))
{
+                            if (!excludedNamespaces.contains(cursor.getName().getNamespaceURI())
+                                    && !SchemaConversionUtils.convertSingleElementToGeronimoSubSchemas(cursor,
end)
+                                    && !this.namespace.equals(cursor.getName().getNamespaceURI()))
{
                                 cursor.setName(new QName(this.namespace, cursor.getName().getLocalPart()));
                             }
                         }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Tue Jun  7 08:13:55 2011
@@ -121,8 +121,6 @@ import org.xml.sax.SAXException;
 public abstract class AbstractWebModuleBuilder implements ModuleBuilder {
     private static final Logger log = LoggerFactory.getLogger(AbstractWebModuleBuilder.class);
     
-    protected static final String OPENEJB_JAR_NAMESPACE = "http://openejb.apache.org/xml/ns/openejb-jar-2.3";
-
     //are we combining all web apps into one bundle in an ear?
     //TODO eliminate this
     protected static final boolean COMBINED_BUNDLE = true;

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
Tue Jun  7 08:13:55 2011
@@ -136,7 +136,6 @@ public class JettyModuleBuilder extends 
         GERONIMO_SCHEMA_CONVERSIONS.put("serverAuthConfig", new NamespaceElementConverter(JASPI_NAMESPACE));
         GERONIMO_SCHEMA_CONVERSIONS.put("serverAuthContext", new NamespaceElementConverter(JASPI_NAMESPACE));
         GERONIMO_SCHEMA_CONVERSIONS.put("serverAuthModule", new NamespaceElementConverter(JASPI_NAMESPACE));
-        GERONIMO_SCHEMA_CONVERSIONS.put("openejb-jar", new NamespaceElementConverter(OPENEJB_JAR_NAMESPACE));
     }
 
     private final Environment defaultEnvironment;

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Tue Jun  7 08:13:55 2011
@@ -20,10 +20,8 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -49,7 +47,6 @@ import javax.xml.ws.WebServiceContext;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.connector.wrapper.ResourceAdapterWrapperGBean;
-import org.apache.geronimo.deployment.ClassPathUtils;
 import org.apache.geronimo.deployment.Deployable;
 import org.apache.geronimo.deployment.DeployableJarFile;
 import org.apache.geronimo.deployment.ModuleIDBuilder;
@@ -132,9 +129,14 @@ import org.apache.openejb.config.Validat
 import org.apache.openejb.config.ValidationFailure;
 import org.apache.openejb.config.WlsConversion;
 import org.apache.openejb.config.WsDeployer;
+import org.apache.openejb.jee.DataSource;
 import org.apache.openejb.jee.EjbJar;
+import org.apache.openejb.jee.EjbLocalRef;
 import org.apache.openejb.jee.EjbRef;
 import org.apache.openejb.jee.EnterpriseBean;
+import org.apache.openejb.jee.EnvEntry;
+import org.apache.openejb.jee.JndiConsumer;
+import org.apache.openejb.jee.MessageDestination;
 import org.apache.openejb.jee.MessageDestinationRef;
 import org.apache.openejb.jee.PersistenceContextRef;
 import org.apache.openejb.jee.PersistenceUnitRef;
@@ -782,10 +784,11 @@ public class EjbModuleBuilder implements
 
         // initialize the naming builders
         if (ejbJar.getAssemblyDescriptor() != null) {
-            //TODO I think this just has MessageDestinations defined in it.
-//                namingBuilder.initContext(ejbJar.getAssemblyDescriptor(),
-//                        module.getVendorDD(),
-//                        ejbModule);
+            final List<MessageDestination> specMessageDestinations = ejbJar.getAssemblyDescriptor().getMessageDestination();
+            final JndiConsumer  jndiConsumer = new MessageDestinationInfo(specMessageDestinations);
+                namingBuilder.initContext(jndiConsumer,
+                        (XmlObject)module.getVendorDD(),
+                        ejbModule);
         }
 
         EjbDeploymentBuilder ejbDeploymentBuilder = new EjbDeploymentBuilder(earContext,
ejbModule, namingBuilder, resourceEnvironmentSetter);
@@ -1396,5 +1399,130 @@ public class EjbModuleBuilder implements
             return ejbJars.values();
         }
     }
+    
+    public static class MessageDestinationInfo implements JndiConsumer {
+        
+        private final IllegalStateException notAllowedException = new IllegalStateException(
+                "this instance is only used for adminObjectRefBuilder to get MessageDestination
defined.");
+        private final List<MessageDestination> specMessageDestinations;
+        
+        public MessageDestinationInfo(List<MessageDestination> specMessageDestinations)
{
+            this.specMessageDestinations = specMessageDestinations == null ? new ArrayList<MessageDestination>()
+                    : specMessageDestinations;
+        }
+        
+        @Override
+        public Collection<DataSource> getDataSource() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, DataSource> getDataSourceMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<EjbLocalRef> getEjbLocalRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, EjbLocalRef> getEjbLocalRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<EjbRef> getEjbRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, EjbRef> getEjbRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<EnvEntry> getEnvEntry() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, EnvEntry> getEnvEntryMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public String getJndiConsumerName() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<MessageDestinationRef> getMessageDestinationRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, MessageDestinationRef> getMessageDestinationRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<PersistenceContextRef> getPersistenceContextRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, PersistenceContextRef> getPersistenceContextRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<PersistenceUnitRef> getPersistenceUnitRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, PersistenceUnitRef> getPersistenceUnitRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<ResourceEnvRef> getResourceEnvRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, ResourceEnvRef> getResourceEnvRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<ResourceRef> getResourceRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, ResourceRef> getResourceRefMap() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Collection<ServiceRef> getServiceRef() {
+            throw notAllowedException;
+        }
+
+        @Override
+        public Map<String, ServiceRef> getServiceRefMap() {
+            throw notAllowedException;
+        }
+
+        /*
+         * allow AdminObjectRefBuilder.initContext(JndiConsumer, XmlObject, Module) to call
this method with reflection
+         * to get MessageDestinations in spec dd.
+         */
+        public List<MessageDestination> getMessageDestination() {
+            return specMessageDestinations;
+        }
+    }
 
 }

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1132900&r1=1132899&r2=1132900&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Tue Jun  7 08:13:55 2011
@@ -127,7 +127,7 @@ public class TomcatModuleBuilder extends
     private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String,
String>();
     private static final Set<String> INGORED_ELEMENT_NAMES = new HashSet<String>();
     private static final Set<String> INGORED_CONTEXT_ATTRIBUTE_NAMES = new HashSet<String>();
-    private static final Map<String, ElementConverter> GERONIMO_SCHEMA_CONVERSIONS
= new HashMap<String, ElementConverter>();
+   // private static final Map<String, ElementConverter> GERONIMO_SCHEMA_CONVERSIONS
= new HashMap<String, ElementConverter>();
     static {
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
         NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.1", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
@@ -157,8 +157,6 @@ public class TomcatModuleBuilder extends
         INGORED_CONTEXT_ATTRIBUTE_NAMES.add("path");
         INGORED_CONTEXT_ATTRIBUTE_NAMES.add("delegate");
         INGORED_CONTEXT_ATTRIBUTE_NAMES.add("docBase".toLowerCase());
-        
-        GERONIMO_SCHEMA_CONVERSIONS.put("openejb-jar", new NamespaceElementConverter(OPENEJB_JAR_NAMESPACE));
     }
 
     private final Environment defaultEnvironment;
@@ -196,7 +194,6 @@ public class TomcatModuleBuilder extends
 
     public void doStart() throws Exception {
         XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
-        SchemaConversionUtils.registerNamespaceConversions(GERONIMO_SCHEMA_CONVERSIONS);
     }
 
     public void doStop() {



Mime
View raw message