geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r449846 - in /geronimo/server/trunk: configs/axis-deployer/src/plan/ configs/j2ee-deployer/src/plan/ modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/ modules/geronimo-naming-builder/src/main/java/org/apache/gero...
Date Mon, 25 Sep 2006 22:54:42 GMT
Author: djencks
Date: Mon Sep 25 15:54:41 2006
New Revision: 449846

URL: http://svn.apache.org/viewvc?view=rev&rev=449846
Log:
GERONIMO-2427  make the axis service-ref builder and the env-entry ref builder work for both
j2ee 1.4 and jee5 xml

Modified:
    geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
    geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
    geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java

Modified: geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml?view=diff&rev=449846&r1=449845&r2=449846
==============================================================================
--- geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/axis-deployer/src/plan/plan.xml Mon Sep 25 15:54:41 2006
@@ -20,6 +20,7 @@
     <gbean name="WebServiceBuilder" class="org.apache.geronimo.axis.builder.AxisBuilder"/>
 
     <gbean name="AxisServiceRefBuilder" class="org.apache.geronimo.axis.builder.AxisServiceRefBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
         <xml-attribute name="defaultEnvironment">
             <environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.1">
                 <dependencies>

Modified: geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml?view=diff&rev=449846&r1=449845&r2=449846
==============================================================================
--- geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-deployer/src/plan/plan.xml Mon Sep 25 15:54:41 2006
@@ -129,6 +129,8 @@
 
     <gbean name="GBeanRefBuilder" class="org.apache.geronimo.naming.deployment.GBeanRefBuilder"/>
     <gbean name="PersistenceContextRefBuilder" class="org.apache.geronimo.naming.deployment.PersistenceContextRefBuilder"/>
-    <gbean name="EnvironmentEntryBuilder" class="org.apache.geronimo.naming.deployment.EnvironmentEntryBuilder"/>
+    <gbean name="EnvironmentEntryBuilder" class="org.apache.geronimo.naming.deployment.EnvironmentEntryBuilder">
+        <attribute name="eeNamespaces">http://java.sun.com/xml/ns/j2ee</attribute>
+    </gbean>
 
 </module>

Modified: geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java?view=diff&rev=449846&r1=449845&r2=449846
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis-builder/src/main/java/org/apache/geronimo/axis/builder/AxisServiceRefBuilder.java
Mon Sep 25 15:54:41 2006
@@ -49,20 +49,19 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public class AxisServiceRefBuilder extends AbstractNamingBuilder {
-    private static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
-    private static final QName SERVICE_REF_QNAME = new QName(J2EE_NAMESPACE, "service-ref");
-    private static final QNameSet SERVICE_REF_QNAME_SET = QNameSet.singleton(SERVICE_REF_QNAME);
+    private final QNameSet serviceRefQNameSet;
     private static final QName GER_SERVICE_REF_QNAME = GerServiceRefDocument.type.getDocumentElementName();
     private static final QNameSet GER_SERVICE_REF_QNAME_SET = QNameSet.singleton(GER_SERVICE_REF_QNAME);
 
     private final AxisBuilder axisBuilder;
 
-    public AxisServiceRefBuilder(Environment defaultEnvironment, AxisBuilder axisBuilder)
{
+    public AxisServiceRefBuilder(Environment defaultEnvironment, String[] eeNamespaces, AxisBuilder
axisBuilder) {
         super(defaultEnvironment);
         this.axisBuilder = axisBuilder;
+        serviceRefQNameSet = buildQNameSet(eeNamespaces, "service-ref");
     }
 
     protected boolean willMergeEnvironment(XmlObject specDD, XmlObject plan) {
@@ -136,12 +135,11 @@
     }
 
     private XmlObject[] getServiceRefs(XmlObject specDD) {
-        XmlObject[] serviceRefsUntyped = specDD.selectChildren(SERVICE_REF_QNAME_SET);
-        return serviceRefsUntyped;
+        return convert(specDD.selectChildren(serviceRefQNameSet), J2EE_CONVERTER, ServiceRefType.type);
     }
 
     public QNameSet getSpecQNameSet() {
-        return SERVICE_REF_QNAME_SET;
+        return serviceRefQNameSet;
     }
 
     public QNameSet getPlanQNameSet() {
@@ -210,9 +208,10 @@
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(AxisServiceRefBuilder.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
+        infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
         infoBuilder.addReference("AxisBuilder", AxisBuilder.class, NameFactory.MODULE_BUILDER);
 
-        infoBuilder.setConstructor(new String[] {"defaultEnvironment", "AxisBuilder"});
+        infoBuilder.setConstructor(new String[] {"defaultEnvironment", "eeNamespaces", "AxisBuilder"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java?view=diff&rev=449846&r1=449845&r2=449846
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilder.java
Mon Sep 25 15:54:41 2006
@@ -35,14 +35,15 @@
 import org.apache.xmlbeans.XmlObject;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
-public class EnvironmentEntryBuilder implements NamingBuilder {
-    private static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+public class EnvironmentEntryBuilder extends AbstractNamingBuilder {
 
-    private static final QName ENV_ENTRY_QNAME = new QName(J2EE_NAMESPACE, "env-entry");
-    private static final QNameSet ENV_ENTRY_QNAME_SET = QNameSet.singleton(ENV_ENTRY_QNAME);
+    private final QNameSet envEntryQNameSet;
 
+    public EnvironmentEntryBuilder(String[] eeNamespaces) {
+        envEntryQNameSet = buildQNameSet(eeNamespaces, "env-entry");
+    }
     public void buildEnvironment(XmlObject specDD, XmlObject plan, Environment environment)
{
     }
 
@@ -50,7 +51,7 @@
     }
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration,
Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException
{
-        XmlObject[] envEntriesUntyped = specDD.selectChildren(ENV_ENTRY_QNAME_SET);
+        XmlObject[] envEntriesUntyped = specDD.selectChildren(envEntryQNameSet);
         for (int i = 0; i < envEntriesUntyped.length; i++) {
             EnvEntryType envEntry = (EnvEntryType) envEntriesUntyped[i].copy().changeType(EnvEntryType.type);
             String name = envEntry.getEnvEntryName().getStringValue().trim();
@@ -94,7 +95,7 @@
     }
 
     public QNameSet getSpecQNameSet() {
-        return ENV_ENTRY_QNAME_SET;
+        return envEntryQNameSet;
     }
 
     public QNameSet getPlanQNameSet() {
@@ -105,6 +106,8 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(EnvironmentEntryBuilder.class,
NameFactory.MODULE_BUILDER);
+        infoBuilder.addAttribute("eeNamespaces", String[].class, true, true);
+        infoBuilder.setConstructor(new String[] {"eeNamespaces"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java?view=diff&rev=449846&r1=449845&r2=449846
==============================================================================
--- geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-naming-builder/src/test/java/org/apache/geronimo/naming/deployment/EnvironmentEntryBuilderTest.java
Mon Sep 25 15:54:41 2006
@@ -39,7 +39,7 @@
  */
 public class EnvironmentEntryBuilderTest extends TestCase {
     private Map componentContext = new HashMap();
-    private NamingBuilder environmentEntryBuilder = new EnvironmentEntryBuilder();
+    private NamingBuilder environmentEntryBuilder = new EnvironmentEntryBuilder(new String[]
{AbstractNamingBuilder.J2EE_NAMESPACE});
 
     private static final String TEST = "<tmp xmlns=\"http://java.sun.com/xml/ns/j2ee\">"
+
             "<env-entry>" +



Mime
View raw message