geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r232898 - in /geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service: GBeanBuilder.java ServiceConfigBuilder.java
Date Mon, 15 Aug 2005 22:17:25 GMT
Author: djencks
Date: Mon Aug 15 15:17:20 2005
New Revision: 232898

URL: http://svn.apache.org/viewcvs?rev=232898&view=rev
Log:
update for xmlbeans bug fix, better way of finding 'any' elements

Modified:
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
    geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java?rev=232898&r1=232897&r2=232898&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
(original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/GBeanBuilder.java
Mon Aug 15 15:17:20 2005
@@ -107,13 +107,12 @@
         gbean.setAttribute(name, value);
     }
 
-    public void setXmlReference(String name, XmlCursor xmlCursor) throws DeploymentException
{
-        String namespace = xmlCursor.getName().getNamespaceURI();
+    public void setXmlReference(String name, XmlObject xmlObject) throws DeploymentException
{
+        String namespace = xmlObject.getDomNode().getNamespaceURI();
         XmlReferenceBuilder builder = (XmlReferenceBuilder) xmlReferenceBuilderMap.get(namespace);
         if (builder == null) {
             throw new DeploymentException("No reference builder deployed for namespace: "
+ namespace);
         }
-        XmlObject xmlObject = xmlCursor.getObject();
         Set references = builder.getReferences(xmlObject, context, j2eeContext, classLoader);
         if (references != null && !references.isEmpty()) {
             gbean.setReferencePatterns(name, references);

Modified: geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=232898&r1=232897&r2=232898&view=diff
==============================================================================
--- geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
(original)
+++ geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Mon Aug 15 15:17:20 2005
@@ -65,7 +65,7 @@
 import org.apache.xmlbeans.QNameSet;
 
 /**
- * @version $Rev: 216115 $ $Date: 2005-07-12 22:22:18 -0700 (Tue, 12 Jul 2005) $
+ * @version $Rev$ $Date$
  */
 public class ServiceConfigBuilder implements ConfigurationBuilder {
     private final URI defaultParentId;
@@ -300,9 +300,7 @@
             for (int i = 0; i < xmlAttributeArray.length; i++) {
                 XmlAttributeType xmlAttributeType = xmlAttributeArray[i];
                 String name = xmlAttributeType.getName().trim();
-//                XmlObject[] anys = xmlAttributeType.selectChildren(XmlAttributeType.type.qnameSetForWildcardElements());
-                String uri = "http://geronimo.apache.org/xml/ns/deployment";
-                XmlObject[] anys = xmlAttributeType.selectChildren(QNameSet.forWildcardNamespaceString("##other",
uri));
+                XmlObject[] anys = xmlAttributeType.selectChildren(XmlAttributeType.type.qnameSetForWildcardElements());
                 if (anys.length != 1) {
                     throw new DeploymentException("Unexpected count of xs:any elements in
xml-attribute " + anys.length + " qnameset: " + XmlAttributeType.type.qnameSetForWildcardElements());
                 }
@@ -331,13 +329,18 @@
             for (int i = 0; i < xmlReferenceArray.length; i++) {
                 XmlAttributeType xmlAttributeType = xmlReferenceArray[i];
                 String name = xmlAttributeType.getName().trim();
-                XmlCursor xmlCursor = xmlAttributeType.newCursor();
-                try {
-                    xmlCursor.toFirstChild();
-                    builder.setXmlReference(name, xmlCursor);
-                } finally {
-                    xmlCursor.dispose();
+                XmlObject[] anys = xmlAttributeType.selectChildren(XmlAttributeType.type.qnameSetForWildcardElements());
+                if (anys.length != 1) {
+                    throw new DeploymentException("Unexpected count of xs:any elements in
xml-attribute " + anys.length + " qnameset: " + XmlAttributeType.type.qnameSetForWildcardElements());
                 }
+                builder.setXmlReference(name, anys[0]);
+//                XmlCursor xmlCursor = xmlAttributeType.newCursor();
+//                try {
+//                    xmlCursor.toFirstChild();
+//                    builder.setXmlReference(name, anys[0]);
+//                } finally {
+//                    xmlCursor.dispose();
+//                }
             }
         }
 



Mime
View raw message