ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1484894 - in /webservices/axiom/trunk/modules: axiom-api/src/main/java/org/apache/axiom/om/impl/builder/ axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/
Date Tue, 21 May 2013 18:02:27 GMT
Author: veithen
Date: Tue May 21 18:02:26 2013
New Revision: 1484894

URL: http://svn.apache.org/r1484894
Log:
Added some debug logging.

Modified:
    webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
    webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java

Modified: webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=1484894&r1=1484893&r2=1484894&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
(original)
+++ webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
Tue May 21 18:02:26 2013
@@ -551,6 +551,9 @@ public abstract class StAXBuilder implem
         // Always advance to the event right after the current node; this also takes
         // care of lookahead
         parserNext();
+        if (log.isDebugEnabled()) {
+            log.debug("Caching disabled; current element level is " + elementLevel);
+        }
         return parser;
     }
     
@@ -589,6 +592,9 @@ public abstract class StAXBuilder implem
         } else {
             target = (OMContainerEx)((OMElement)container).getParent();
         }
+        if (log.isDebugEnabled()) {
+            log.debug("Caching re-enabled; new element level: " + elementLevel + "; done="
+ done);
+        }
         if (done && autoClose) {
             close();
         }

Modified: webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java?rev=1484894&r1=1484893&r2=1484894&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
(original)
+++ webservices/axiom/trunk/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXOMBuilder.java
Tue May 21 18:02:26 2013
@@ -660,6 +660,9 @@ public class StAXOMBuilder extends StAXB
      */
     int parserNext() {
         if (lookAheadToken >= 0) {
+            if (log.isDebugEnabled()) {
+                log.debug("Consuming look-ahead token " + XMLEventUtils.getEventTypeString(lookAheadToken));
+            }
             int token = lookAheadToken;
             lookAheadToken = -1; // Reset
             return token;
@@ -706,10 +709,14 @@ public class StAXOMBuilder extends StAXB
                 lookAheadToken = parserNext();
             }
             if (lookAheadToken == XMLStreamConstants.START_ELEMENT) {
+                log.debug("Performing look-ahead; START_ELEMENT found");
                 return true;
             } else if (lookAheadToken == XMLStreamConstants.END_ELEMENT ||
                     lookAheadToken == XMLStreamConstants.START_DOCUMENT ||
                     lookAheadToken == XMLStreamConstants.END_DOCUMENT) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Performing look-ahead; " + XMLEventUtils.getEventTypeString(lookAheadToken)
+ " found");
+                }
                 next();
                 return false;  // leaving scope...start element not found
             } else {

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java?rev=1484894&r1=1484893&r2=1484894&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
Tue May 21 18:02:26 2013
@@ -58,6 +58,7 @@ import org.apache.axiom.om.impl.builder.
 import org.apache.axiom.om.impl.common.IContainer;
 import org.apache.axiom.om.impl.common.OMDataSourceUtil;
 import org.apache.axiom.util.namespace.MapBasedNamespaceContext;
+import org.apache.axiom.util.stax.XMLEventUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -636,7 +637,11 @@ final class Navigator extends PullSerial
                 container = parent;
                 depth++;
             }
-            PullThroughWrapper wrapper = new PullThroughWrapper(serializer, builder, container,
builder.disableCaching(), depth);
+            XMLStreamReader reader = builder.disableCaching();
+            if (log.isDebugEnabled()) {
+                log.debug("Switching to pull-through mode; first event is " + XMLEventUtils.getEventTypeString(reader.getEventType())
+ "; depth is " + depth);
+            }
+            PullThroughWrapper wrapper = new PullThroughWrapper(serializer, builder, container,
reader, depth);
             serializer.pushState(wrapper);
             node = container;
             visited = true;

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java?rev=1484894&r1=1484893&r2=1484894&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
Tue May 21 18:02:26 2013
@@ -35,11 +35,15 @@ import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.util.stax.AbstractXMLStreamReader;
 import org.apache.axiom.util.stax.XMLStreamReaderUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 /**
  * {@link XMLStreamReader} implementation that generates events from a given Axiom tree.
  */
 public final class PullSerializer extends AbstractXMLStreamReader implements DataHandlerReader,
DTDReader, CharacterDataReader {
+    private static final Log log = LogFactory.getLog(PullSerializer.class);
+    
     /**
      * The current state of the serializer.
      */
@@ -70,6 +74,9 @@ public final class PullSerializer extend
      * @throws XMLStreamException
      */
     void switchState(PullSerializerState newState) throws XMLStreamException {
+        if (log.isDebugEnabled()) {
+            log.debug("Switching to state " + newState);
+        }
         PullSerializerState oldState = state;
         PullSerializerState savedState = this.savedState;
         state = newState;
@@ -91,6 +98,9 @@ public final class PullSerializer extend
         if (savedState != null) {
             throw new IllegalStateException();
         }
+        if (log.isDebugEnabled()) {
+            log.debug("Switching to state " + newState);
+        }
         savedState = state;
         state = newState;
     }
@@ -106,6 +116,9 @@ public final class PullSerializer extend
         if (savedState == null) {
             throw new IllegalStateException();
         }
+        if (log.isDebugEnabled()) {
+            log.debug("Restoring state " + savedState);
+        }
         this.savedState = null;
         switchState(savedState);
         savedState.restored();



Mime
View raw message