Author: veithen
Date: Sat Aug  1 21:47:20 2009
New Revision: 799934

URL: http://svn.apache.org/viewvc?rev=799934&view=rev
Log:
Moved the close method from OMNode to OMSerializable since it is also 
applicable to OMDocument.

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
    webservices/commons/trunk/modules/axiom/src/docbkx/userguide.xml

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java?rev=799934&r1=799933&r2=799934&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNode.java
 Sat Aug  1 21:47:20 2009
@@ -252,10 +252,4 @@
      * together with attachement data. This becomes handy when user wants to 
free the input stream.
      */
     void buildWithAttachments();
-
-    /**
-     * If a builder and parser is associated with the node, it is closed.
-     * @param build if true, the object is built first before closing the 
builder/parser
-     */
-    void close(boolean build);
 }

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java?rev=799934&r1=799933&r2=799934&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
 Sat Aug  1 21:47:20 2009
@@ -58,6 +58,12 @@
     void build();
 
     /**
+     * If a builder and parser is associated with the node, it is closed.
+     * @param build if true, the object is built first before closing the 
builder/parser
+     */
+    void close(boolean build);
+
+    /**
      * Serializes the information item with caching.
      *
      * @param xmlWriter

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java?rev=799934&r1=799933&r2=799934&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMNodeImpl.java
 Sat Aug  1 21:47:20 2009
@@ -310,21 +310,6 @@
         }
     }
 
-    
-    public void close(boolean build) {
-        if (build) {
-            this.build();
-        }
-        this.done = true;
-        
-        // If this is a StAXBuilder, close it.
-        if (builder instanceof StAXBuilder &&
-            !((StAXBuilder) builder).isClosed()) {
-            ((StAXBuilder) builder).releaseParserOnClose(true);
-            ((StAXBuilder) builder).close();
-        }
-    }
-
     public void serialize(OutputStream output) throws XMLStreamException {
         XMLStreamWriter xmlStreamWriter = 
StAXUtils.createXMLStreamWriter(output);
         try {

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java?rev=799934&r1=799933&r2=799934&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSerializableImpl.java
 Sat Aug  1 21:47:20 2009
@@ -27,6 +27,7 @@
 import org.apache.axiom.om.OMSerializable;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
+import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -75,6 +76,20 @@
         }
     }
     
+    public void close(boolean build) {
+        if (build) {
+            this.build();
+        }
+        this.done = true;
+        
+        // If this is a StAXBuilder, close it.
+        if (builder instanceof StAXBuilder &&
+            !((StAXBuilder) builder).isClosed()) {
+            ((StAXBuilder) builder).releaseParserOnClose(true);
+            ((StAXBuilder) builder).close();
+        }
+    }
+    
     public abstract void setComplete(boolean state);
 
     /**

Modified: webservices/commons/trunk/modules/axiom/src/docbkx/userguide.xml
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/src/docbkx/userguide.xml?rev=799934&r1=799933&r2=799934&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/docbkx/userguide.xml (original)
+++ webservices/commons/trunk/modules/axiom/src/docbkx/userguide.xml Sat Aug  1 
21:47:20 2009
@@ -634,7 +634,7 @@
                 As we have seen previously, when creating an object model from 
a stream, all nodes keep a
                 reference to the builder and thus to the underlying parser. 
Since an XML parser instance is
                 a heavyweight object, it is important to release it as soon as 
it is no longer required.
-                The <methodname>close</methodname> method defined by the 
<classname>OMNode</classname>
+                The <methodname>close</methodname> method defined by the 
<classname>OMSerializable</classname>
                 interface it used for that. Note that it doesn't matter an 
which node this method is
                 called; it will always close and release the parser for the 
whole tree. The
                 <varname>build</varname> parameter of the 
<methodname>close</methodname> method specifies


Reply via email to