servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r515582 - in /incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp: FragmentStreamReader.java StAXSourceTransformer.java StaxSource.java
Date Wed, 07 Mar 2007 14:23:34 GMT
Author: gnodet
Date: Wed Mar  7 06:23:33 2007
New Revision: 515582

URL: http://svn.apache.org/viewvc?view=rev&rev=515582
Log:
SM-870: StAXSourceTransformer should reuse the XMLStreamReader when available

Modified:
    incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReader.java
    incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StAXSourceTransformer.java
    incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StaxSource.java

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReader.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReader.java?view=diff&rev=515582&r1=515581&r2=515582
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReader.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/FragmentStreamReader.java
Wed Mar  7 06:23:33 2007
@@ -56,6 +56,10 @@
 		return event;
 	}
 
+    public boolean hasNext() throws XMLStreamException {
+        return event != END_DOCUMENT;
+    }
+
 	public int next() throws XMLStreamException {
 		switch (state) {
 		case STATE_START_DOC:

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StAXSourceTransformer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StAXSourceTransformer.java?view=diff&rev=515582&r1=515581&r2=515582
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StAXSourceTransformer.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StAXSourceTransformer.java
Wed Mar  7 06:23:33 2007
@@ -63,6 +63,9 @@
     }
     
     public XMLStreamReader toXMLStreamReader(Source source) throws XMLStreamException, TransformerException
{
+        if (source instanceof StaxSource) {
+            return ((StaxSource) source).getXMLStreamReader();
+        }
         // It seems that woodstox 2.9.3 throws some NPE in the servicemix-soap
         // when using DOM, so use our own dom / stax parser
         if (source instanceof DOMSource) {

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StaxSource.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StaxSource.java?view=diff&rev=515582&r1=515581&r2=515582
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StaxSource.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/StaxSource.java
Wed Mar  7 06:23:33 2007
@@ -53,6 +53,10 @@
         return this;
     }
 
+    public XMLStreamReader getXMLStreamReader() {
+        return streamReader;
+    }
+
     protected void parse() throws SAXException {
         try {
             while (true) {



Mime
View raw message