geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: rev 47614 - in geronimo/trunk/modules/naming/src: java/org/apache/geronimo/naming/deployment schema
Date Thu, 30 Sep 2004 23:16:35 GMT
Author: dain
Date: Thu Sep 30 16:16:34 2004
New Revision: 47614

Modified:
   geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
   geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd
Log:
http://issues.apache.org/jira/browse/GERONIMO-339
Added support for ejb-link in geronimo deployment descriptors


Modified: geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
==============================================================================
--- geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
(original)
+++ geronimo/trunk/modules/naming/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Thu Sep 30 16:16:34 2004
@@ -17,22 +17,25 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.util.Map;
-import java.lang.String;
 import java.net.URI;
-
+import java.util.Map;
 import javax.naming.NamingException;
 import javax.transaction.UserTransaction;
 
-import org.apache.geronimo.xbeans.j2ee.*;
-import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
 import org.apache.geronimo.deployment.DeploymentException;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.EJBRefContext;
 import org.apache.geronimo.naming.java.ComponentContextBuilder;
 import org.apache.geronimo.naming.java.ReadOnlyContext;
 import org.apache.geronimo.naming.jmx.JMXReferenceFactory;
-import org.apache.geronimo.j2ee.deployment.EARContext;
-import org.apache.geronimo.j2ee.deployment.EJBRefContext;
+import org.apache.geronimo.xbeans.geronimo.naming.GerLocalRefType;
+import org.apache.geronimo.xbeans.geronimo.naming.GerRemoteRefType;
+import org.apache.geronimo.xbeans.j2ee.EjbLocalRefType;
+import org.apache.geronimo.xbeans.j2ee.EjbRefType;
+import org.apache.geronimo.xbeans.j2ee.EnvEntryType;
+import org.apache.geronimo.xbeans.j2ee.MessageDestinationRefType;
+import org.apache.geronimo.xbeans.j2ee.ResourceEnvRefType;
+import org.apache.geronimo.xbeans.j2ee.ResourceRefType;
 
 /**
  *
@@ -143,7 +146,14 @@
 
             boolean isSession = "Session".equals(ejbRef.getEjbRefType().getStringValue());
 
-            String ejbLink = getJ2eeStringValue(ejbRef.getEjbLink());
+            String ejbLink = null;
+            GerRemoteRefType remoteRef = (GerRemoteRefType) ejbRefMap.get(ejbRefName);
+            if (remoteRef != null && remoteRef.isSetEjbLink()) {
+                ejbLink = remoteRef.getEjbLink();
+            } else if (ejbRef.isSetEjbLink()) {
+                ejbLink = getJ2eeStringValue(ejbRef.getEjbLink());
+            }
+
             if (ejbLink != null) {
                 try {
                     builder.bind(ejbRefName, ejbRefContext.getEJBRemoteRef(uri, ejbLink,
isSession, home, remote));
@@ -151,7 +161,6 @@
                     throw new DeploymentException("Unable to to bind ejb-ref: ejb-ref-name="
+ ejbRefName);
                 }
             } else {
-                GerRemoteRefType remoteRef = (GerRemoteRefType) ejbRefMap.get(ejbRefName);
                 if (remoteRef == null) {
                     throw  new DeploymentException("No geronimo configuration for resource
ref named: " + ejbRefName);
                 }
@@ -161,7 +170,6 @@
                     throw new DeploymentException("Invalid env-entry definition for name:
" + ejbRefName, e);
                 }
             }
-
         }
     }
 
@@ -180,7 +188,14 @@
 
             boolean isSession = "Session".equals(ejbLocalRef.getEjbRefType().getStringValue());
 
-            String ejbLink = getJ2eeStringValue(ejbLocalRef.getEjbLink());
+            String ejbLink = null;
+            GerLocalRefType localRef = (GerLocalRefType) ejbLocalRefMap.get(ejbRefName);
+            if (localRef != null && localRef.isSetEjbLink()) {
+                ejbLink = localRef.getEjbLink();
+            } else if (ejbLocalRef.isSetEjbLink()) {
+                ejbLink = getJ2eeStringValue(ejbLocalRef.getEjbLink());
+            }
+
             if (ejbLink != null) {
                 try {
                     builder.bind(ejbRefName, ejbRefContext.getEJBLocalRef(uri, ejbLink, isSession,
localHome, local));
@@ -188,7 +203,6 @@
                     throw new DeploymentException("Unable to to bind ejb-local-ref: ejb-ref-name="
+ ejbRefName);
                 }
             } else {
-                GerLocalRefType localRef = (GerLocalRefType) ejbLocalRefMap.get(ejbRefName);
                 if (localRef == null) {
                     throw  new DeploymentException("No geronimo configuration for resource
ref named: " + ejbRefName);
                 }

Modified: geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd
==============================================================================
--- geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd	(original)
+++ geronimo/trunk/modules/naming/src/schema/geronimo-naming.xsd	Thu Sep 30 16:16:34 2004
@@ -38,16 +38,12 @@
  temporary (I hope) individual elements while xmlbeans group handling is straightened out
  -->
 
-    <xsd:element name="ejb-ref"
-        type="gernaming:remote-refType"/>
-    <xsd:element name="ejb-local-ref"
-        type="gernaming:local-refType"/>
+    <xsd:element name="ejb-ref" type="gernaming:remote-refType"/>
+    <xsd:element name="ejb-local-ref" type="gernaming:local-refType"/>
     <!-- leave web services out until I know what they do -->
     <!--xsd:group ref="service-refGroup"/-->
-    <xsd:element name="resource-ref"
-        type="gernaming:local-refType"/>
-    <xsd:element name="resource-env-ref"
-        type="gernaming:local-refType"/>
+    <xsd:element name="resource-ref" type="gernaming:local-refType"/>
+    <xsd:element name="resource-env-ref" type="gernaming:local-refType"/>
     
     <xsd:group name="jndiEnvironmentRefsGroup">
         <xsd:annotation>
@@ -59,20 +55,12 @@
             </xsd:documentation>
         </xsd:annotation>
         <xsd:sequence>
-            <xsd:element name="ejb-ref"
-                type="gernaming:remote-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
-            <xsd:element name="ejb-local-ref"
-                type="gernaming:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element name="ejb-ref" type="gernaming:remote-refType" minOccurs="0"
maxOccurs="unbounded"/>
+            <xsd:element name="ejb-local-ref" type="gernaming:local-refType" minOccurs="0"
maxOccurs="unbounded"/>
             <!-- leave web services out until I know what they do -->
             <!--xsd:group ref="service-refGroup"/-->
-            <xsd:element name="resource-ref"
-                type="gernaming:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
-            <xsd:element name="resource-env-ref"
-                type="gernaming:local-refType"
-                minOccurs="0" maxOccurs="unbounded"/>
+            <xsd:element name="resource-ref" type="gernaming:local-refType" minOccurs="0"
maxOccurs="unbounded"/>
+            <xsd:element name="resource-env-ref" type="gernaming:local-refType" minOccurs="0"
maxOccurs="unbounded"/>
         </xsd:sequence>
     </xsd:group>
 
@@ -86,6 +74,7 @@
                     <xsd:element name="target-name" type="xsd:string"/>
                 </xsd:sequence>
                 <xsd:element name="external-uri" type="xsd:string"/>
+                <xsd:element name="ejb-link" type="xsd:string"/>
             </xsd:choice>
         </xsd:sequence>
     </xsd:complexType>
@@ -102,6 +91,7 @@
                             <xsd:element name="target-name" type="xsd:string"/>
                         </xsd:sequence>
                         <xsd:element name="external-uri" type="xsd:string"/>
+                        <xsd:element name="ejb-link" type="xsd:string"/>
                     </xsd:choice>
                 </xsd:sequence>
             </xsd:restriction>

Mime
View raw message