tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r659734 - in /incubator/tuscany/java/sca/modules: ./ binding-ws-axis2/ databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/ databinding-jaxb-axiom/ databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding...
Date Sat, 24 May 2008 00:55:17 GMT
Author: rfeng
Date: Fri May 23 17:55:14 2008
New Revision: 659734

URL: http://svn.apache.org/viewvc?rev=659734&view=rev
Log:
Add databinding-jaxb-axiom to the main build and activate it with binding-ws-axis2 to take
advantage of the SOAP payload lazy serialization

Modified:
    incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml
    incubator/tuscany/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/pom.xml
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
    incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
    incubator/tuscany/java/sca/modules/pom.xml

Modified: incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/binding-ws-axis2/pom.xml Fri May 23 17:55:14 2008
@@ -73,6 +73,7 @@
             <groupId>org.apache.tuscany.sca</groupId>
             <artifactId>tuscany-core-databinding</artifactId>
             <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
         </dependency>
 
         <dependency>
@@ -80,6 +81,13 @@
             <artifactId>tuscany-databinding-axiom</artifactId>
             <version>2.0-incubating-SNAPSHOT</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-databinding-jaxb-axiom</artifactId>
+            <version>2.0-incubating-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>        
 
         <dependency>
             <groupId>org.apache.tuscany.sca</groupId>

Modified: incubator/tuscany/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-axiom/src/main/java/org/apache/tuscany/sca/databinding/axiom/AxiomHelper.java
Fri May 23 17:55:14 2008
@@ -129,14 +129,14 @@
         String prefix = name.getPrefix();
 
         OMNamespace ns = null;
-        if (namespaceURI.length() != 0) {
-            // Qualified Element: we need an OMNamespace         
-            if (prefix.length() == 0) {
-                // The prefix does not appear to be specified, let's create one
-                prefix = DEFAULT_PREFIX;
-            }
-            ns = factory.createOMNamespace(namespaceURI, prefix);
+
+        // Qualified Element: we need an OMNamespace         
+        if (prefix.length() == 0) {
+            // The prefix does not appear to be specified, let's create one
+            prefix = DEFAULT_PREFIX;
         }
+        ns = factory.createOMNamespace(namespaceURI, prefix);
+ 
         return ns;
     }
 }

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/pom.xml?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/pom.xml Fri May 23 17:55:14
2008
@@ -42,7 +42,7 @@
         <dependency>
             <groupId>org.apache.ws.commons.axiom</groupId>
             <artifactId>axiom-api</artifactId>
-            <version>1.2.7</version>
+            <version>1.2.5</version>
             <exclusions>
                 <exclusion>
                     <groupId>xerces</groupId>
@@ -62,7 +62,7 @@
         <dependency>
             <groupId>org.apache.ws.commons.axiom</groupId>
             <artifactId>axiom-impl</artifactId>
-            <version>1.2.7</version>
+            <version>1.2.5</version>
             <scope>runtime</scope>
         </dependency>
     </dependencies>

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/AxiomHelper.java
Fri May 23 17:55:14 2008
@@ -129,14 +129,12 @@
         String prefix = name.getPrefix();
 
         OMNamespace ns = null;
-        if (namespaceURI.length() != 0) {
-            // Qualified Element: we need an OMNamespace         
-            if (prefix.length() == 0) {
-                // The prefix does not appear to be specified, let's create one
-                prefix = DEFAULT_PREFIX;
-            }
-            ns = factory.createOMNamespace(namespaceURI, prefix);
+        // Qualified Element: we need an OMNamespace         
+        if (prefix.length() == 0) {
+            // The prefix does not appear to be specified, let's create one
+            prefix = DEFAULT_PREFIX;
         }
+        ns = factory.createOMNamespace(namespaceURI, prefix);
         return ns;
     }
 }

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/JAXB2OMElement.java
Fri May 23 17:55:14 2008
@@ -73,19 +73,18 @@
         JAXBIntrospector introspector = jaxbContext.createJAXBIntrospector();
         Object element = null;
         Class<?> type = null;
-        if (introspector.isElement(source)) {
+        if (source != null && introspector.isElement(source)) {
             if (name == JAXBDataBinding.ROOT_ELEMENT) {
                 element = source;
             } else {
                 source = JAXBIntrospector.getValue(source);
             }
-        } else {
-            type = source.getClass();
+        } 
+        if (element == null) {
+            type = source == null ? Object.class : source.getClass();
             if (context != null) {
                 type = context.getSourceDataType().getPhysical();
             }
-        }
-        if (element == null) {
             element = new JAXBElement(name, type, source);
         }
         JAXBDataSource dataSource = new JAXBDataSource(element, jaxbContext);

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/OMElement2JAXB.java
Fri May 23 17:55:14 2008
@@ -54,7 +54,7 @@
                     // Marshalling directly to the output stream is faster than marshalling
through the
                     // XMLStreamWriter. 
                     // Take advantage of this optimization if there is an output stream.
-                    JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context,
true);
+                    JAXBContext jaxbContext = JAXBContextHelper.createJAXBContext(context,
false);
                     Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
                     XMLStreamReader reader = source.getXMLStreamReaderWithoutCaching();
                     Object result =

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java
Fri May 23 17:55:14 2008
@@ -19,23 +19,15 @@
 
 package org.apache.tuscany.sca.databinding.jaxb.axiom.ext;
 
-import javax.xml.bind.JAXBException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMSourcedElement;
-import org.apache.axiom.om.impl.builder.CustomBuilder;
 
 /**
  * JAXBCustomBuilder creates an OMSourcedElement backed by a JAXBDataSource
  * for the specified namespace and localPart.
  */
-public class JAXBCustomBuilder implements CustomBuilder {
+public class JAXBCustomBuilder 
+//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+// implements CustomBuilder 
+{
 
     private JAXBDSContext jdsContext;
 
@@ -48,6 +40,8 @@
         this.jdsContext = context;
     }
 
+ // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+    /*
     public OMElement create(String namespace,
                             String localPart,
                             OMContainer parent,
@@ -67,7 +61,7 @@
             Object jaxb = jdsContext.unmarshal(reader);
 
             OMDataSource ds = new JAXBDataSourceExt(jaxb, jdsContext);
-            OMSourcedElement omse = factory.createOMElement(ds, localPart, ns);
+            OMElement omse = factory.createOMElement(ds, localPart, ns);
 
             parent.addChild(omse);
             // JAXBCustomBuilderMonitor.updateTotalCreates();
@@ -77,6 +71,7 @@
             throw new OMException(e);
         }
     }
+    */
 
     /**
      * The namespace identifier for the SOAP 1.1 envelope.

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java
Fri May 23 17:55:14 2008
@@ -33,17 +33,19 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.om.util.StAXUtils;
 
 /**
  * OMDataSource backed by a jaxb object
  */
-public class JAXBDataSourceExt extends OMDataSourceExtBase {
+public class JAXBDataSourceExt
+
+//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+// extends OMDataSourceExtBase  
+{
 
     private static final Logger log = Logger.getLogger(JAXBDataSourceExt.class.getName());
 
@@ -59,9 +61,10 @@
     public void close() {
     }
 
-    public OMDataSourceExt copy() {
-        return new JAXBDataSourceExt(jaxb, context);
-    }
+    // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+    //    public OMDataSourceExt copy() {
+    //        return new JAXBDataSourceExt(jaxb, context);
+    //    }
 
     public Object getObject() {
         return jaxb;

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java
Fri May 23 17:55:14 2008
@@ -34,15 +34,16 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
-import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
 import org.apache.axiom.om.util.StAXUtils;
 
 /**
  * OMDataSource backed by a source
  */
-public class SourceDataSource extends OMDataSourceExtBase {
+public class SourceDataSource
+// FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+// extends OMDataSourceExtBase 
+{
     private Source data;
 
     public SourceDataSource(Source data) {
@@ -53,9 +54,10 @@
     public void close() {
     }
 
-    public OMDataSourceExt copy() {
-        return null;
-    }
+    // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+    //    public OMDataSourceExt copy() {
+    //        return new SourceDataSource(data);
+    //    }
 
     public Object getObject() {
         return data;

Modified: incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
(original)
+++ incubator/tuscany/java/sca/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java
Fri May 23 17:55:14 2008
@@ -27,16 +27,18 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
-import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.ds.OMDataSourceExtBase;
 import org.apache.axiom.om.util.StAXUtils;
 
 /**
  * OMDataSource backed by a string containing xml data
  */
 // FIXME: To be refectored into databinding-axiom
-public class XMLStringDataSource extends OMDataSourceExtBase {
+public class XMLStringDataSource
+
+//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+// extends OMDataSourceExtBase 
+{
     private String data;
 
     public XMLStringDataSource(String data) {
@@ -47,9 +49,10 @@
     public void close() {
     }
 
-    public OMDataSourceExt copy() {
-        return new XMLStringDataSource(data);
-    }
+    // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7
+    //    public OMDataSourceExt copy() {
+    //        return new XMLStringDataSource(data);
+    //    }
 
     public Object getObject() {
         return data;
@@ -70,7 +73,6 @@
         }
     }
 
-
     public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException {
         return data.getBytes(encoding);
     }

Modified: incubator/tuscany/java/sca/modules/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/pom.xml?rev=659734&r1=659733&r2=659734&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/pom.xml Fri May 23 17:55:14 2008
@@ -83,6 +83,7 @@
                 <module>databinding</module>
                 <module>databinding-axiom</module>
                 <module>databinding-jaxb</module>
+                <module>databinding-jaxb-axiom</module>
                 <module>databinding-sdo</module>
                 <module>databinding-sdo-axiom</module>
                 <module>databinding-json</module>



Mime
View raw message