geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jsis...@apache.org
Subject svn commit: r380603 - /geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Date Fri, 24 Feb 2006 06:33:17 GMT
Author: jsisson
Date: Thu Feb 23 22:33:15 2006
New Revision: 380603

URL: http://svn.apache.org/viewcvs?rev=380603&view=rev
Log:
GERONIMO-1649 - Fix Invalid deployment descriptor error when deploying an EJB 2.0 MDB (see
associated test case in rev 380600)

Modified:
    geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java

Modified: geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java?rev=380603&r1=380602&r2=380603&view=diff
==============================================================================
--- geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
(original)
+++ geronimo/branches/1.0/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Thu Feb 23 22:33:15 2006
@@ -216,6 +216,7 @@
         }
         XmlCursor cursor = xmlObject.newCursor();
         XmlCursor moveable = xmlObject.newCursor();
+        //cursor is intially located before the logical STARTDOC token
         try {
             cursor.toFirstChild();
             if ("http://java.sun.com/xml/ns/j2ee".equals(cursor.getName().getNamespaceURI()))
{
@@ -223,6 +224,7 @@
                 validateDD(result);
                 return (EjbJarDocument) result;
             }
+            // deployment descriptor is probably in EJB 1.1 or 2.0 format
             XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
             String publicId = xmlDocumentProperties.getDoctypePublicId();
             String cmpVersion;
@@ -495,14 +497,15 @@
                         cursor.toNextSibling(J2EE_NAMESPACE, "transaction-type");
                     } else {
                         cursor.toNextSibling(J2EE_NAMESPACE, "transaction-type");
-                        //add messaging-type
+                        //insert messaging-type (introduced in EJB 2.1 spec) before transaction-type
                         cursor.insertElementWithText("messaging-type", J2EE_NAMESPACE, "javax.jms.MessageListener");
+                        //cursor still on transaction-type
                     }
                     if (!cursor.toNextSibling(J2EE_NAMESPACE, "activation-config")) {
                         boolean hasProperties = false;
                         //skip transaction-type
                         cursor.toNextSibling();
-                        //add activation-config-properties.
+                        //convert EJB 2.0 elements to activation-config-properties.
                         moveable.toCursor(cursor);
                         cursor.push();
                         cursor.beginElement("activation-config", J2EE_NAMESPACE);
@@ -519,9 +522,15 @@
                         }
                         cursor.pop();
                         if (!hasProperties) {
+                            //the activation-config element that we created is empty so delete
it
                             cursor.toPrevSibling();
                             cursor.removeXml();
+                            //cursor should now be at first element in JNDIEnvironmentRefsGroup
                         }
+                    } else {
+                        //cursor pointing at activation-config
+                        //cursor.toNextSibling();
+                        //cursor should now be at first element in JNDIEnvironmentRefsGroup
                     }
                     cursor.toNextSibling();
                     convertToJNDIEnvironmentRefsGroup(cursor, moveable);



Mime
View raw message