cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r774818 - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/ rt/core/src/main/java/org/apache/cxf/databinding/source/
Date Thu, 14 May 2009 15:22:25 GMT
Author: dkulp
Date: Thu May 14 15:22:25 2009
New Revision: 774818

URL: http://svn.apache.org/viewvc?rev=774818&view=rev
Log:
Merged revisions 774558 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r774558 | dkulp | 2009-05-13 18:11:40 -0400 (Wed, 13 May 2009) | 2 lines
  
  Some optimizations for message mode SOAP dispatcher things
........

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
    cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 14 15:22:25 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java?rev=774818&r1=774817&r2=774818&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/AbstractDOMStreamReader.java
Thu May 14 15:22:25 2009
@@ -192,6 +192,17 @@
      */
     public abstract String getElementText() throws XMLStreamException;
 
+    public void consumeFrame() {
+        frame.started = true;
+        frame.ended = true;
+        if (frame.isDocument()) {
+            currentEvent = END_DOCUMENT;                
+        } else {
+            currentEvent = END_ELEMENT;
+            endElement();
+        }
+    }
+    
     /*
      * (non-Javadoc)
      * 

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java?rev=774818&r1=774817&r2=774818&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
Thu May 14 15:22:25 2009
@@ -44,7 +44,9 @@
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.staxutils.DepthXMLStreamReader;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.staxutils.W3CDOMStreamReader;
 
 
 
@@ -116,8 +118,19 @@
         // Use a DOMSource for now, we should really use a StaxSource/SAXSource though for

         // performance reasons
         try {
-            Document document = StaxUtils.read(reader);
-            return new DOMSource(document);
+            XMLStreamReader reader2 = reader;
+            if (reader2 instanceof DepthXMLStreamReader) {
+                reader2 = ((DepthXMLStreamReader)reader2).getReader();
+            }
+            if (reader2 instanceof W3CDOMStreamReader) {
+                W3CDOMStreamReader domreader = (W3CDOMStreamReader)reader2;
+                Object o = new DOMSource(domreader.getCurrentElement());
+                domreader.consumeFrame();
+                return o;
+            } else {
+                Document document = StaxUtils.read(reader);
+                return new DOMSource(document);
+            }
         } catch (XMLStreamException e) {
             throw new Fault(new Message("COULD_NOT_READ_XML_STREAM", LOG), e);
         }

Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java?rev=774818&r1=774817&r2=774818&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataWriter.java
Thu May 14 15:22:25 2009
@@ -53,6 +53,22 @@
                 reader = StaxUtils.createXMLStreamReader(ds.getInputStream());
                 StaxUtils.copy(reader, writer);
                 reader.close();
+            } else if (obj instanceof Node) {
+                Node nd = (Node)obj;
+                if (writer instanceof W3CDOMStreamWriter
+                    && ((W3CDOMStreamWriter)writer).getCurrentNode() != null) {
+                    W3CDOMStreamWriter dw = (W3CDOMStreamWriter)writer;
+                    
+                    if (nd.getOwnerDocument() == dw.getCurrentNode().getOwnerDocument())
{
+                        dw.getCurrentNode().appendChild(nd);
+                        return;
+                    } else if (nd instanceof DocumentFragment) {
+                        nd = dw.getDocument().importNode(nd, true);
+                        dw.getCurrentNode().appendChild(nd);
+                        return;
+                    }
+                }
+                StaxUtils.writeNode(nd, writer, true);
             } else {
                 Source s = (Source) obj;
                 if (s instanceof DOMSource



Mime
View raw message