You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2008/08/07 16:43:45 UTC

[jira] Created: (WSCOMMONS-368) OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects

OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects
--------------------------------------------------------------------------------------------

                 Key: WSCOMMONS-368
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-368
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Rich Scheuerle
            Assignee: Rich Scheuerle
            Priority: Minor


Problem:
There are several serialize methods in the llom and dom implementations that cause excessive wrappering of MTOMXMLStreamWriter objects.  This increases call path and temporary objects.  (Plus it can cause problems because the inner MTOMXMLStreamWriter may have special OMFormat settings that are masked by the outer MTOMXMLStreamWriter).

Example  Current, Bad Code:

/**
     * Serializes the node with caching.
     *
     * @param xmlWriter
     * @throws javax.xml.stream.XMLStreamException
     *
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        
       MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(xmlWriter);
        internalSerialize(writer);
        writer.flush();
    }

Corrected Code:

/**
     * Serializes the node with caching.
     *
     * @param xmlWriter
     * @throws javax.xml.stream.XMLStreamException
     *
     */
    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
        
        // If the input xmlWriter is not an MTOMXMLStreamWriter, then wrapper it
        MTOMXMLStreamWriter writer = xmlWriter instanceof MTOMXMLStreamWriter ?
                (MTOMXMLStreamWriter) xmlWriter : 
                    new MTOMXMLStreamWriter(xmlWriter);
        internalSerialize(writer);
        writer.flush();
    }


Next Step:

I am making this change in 4 places in Axiom.  I will commit the change after I complete Axiom and Axis2 testing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (WSCOMMONS-368) OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on WSCOMMONS-368 started by Rich Scheuerle.

> OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects
> --------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-368
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-368
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Problem:
> There are several serialize methods in the llom and dom implementations that cause excessive wrappering of MTOMXMLStreamWriter objects.  This increases call path and temporary objects.  (Plus it can cause problems because the inner MTOMXMLStreamWriter may have special OMFormat settings that are masked by the outer MTOMXMLStreamWriter).
> Example  Current, Bad Code:
> /**
>      * Serializes the node with caching.
>      *
>      * @param xmlWriter
>      * @throws javax.xml.stream.XMLStreamException
>      *
>      */
>     public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
>         
>        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(xmlWriter);
>         internalSerialize(writer);
>         writer.flush();
>     }
> Corrected Code:
> /**
>      * Serializes the node with caching.
>      *
>      * @param xmlWriter
>      * @throws javax.xml.stream.XMLStreamException
>      *
>      */
>     public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
>         
>         // If the input xmlWriter is not an MTOMXMLStreamWriter, then wrapper it
>         MTOMXMLStreamWriter writer = xmlWriter instanceof MTOMXMLStreamWriter ?
>                 (MTOMXMLStreamWriter) xmlWriter : 
>                     new MTOMXMLStreamWriter(xmlWriter);
>         internalSerialize(writer);
>         writer.flush();
>     }
> Next Step:
> I am making this change in 4 places in Axiom.  I will commit the change after I complete Axiom and Axis2 testing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WSCOMMONS-368) OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-368?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved WSCOMMONS-368.
--------------------------------------

    Resolution: Fixed

Committed 683673

> OMNodeImpl serialize methods are causing excessive wrappering of MTOMXMLStreamWriter objects
> --------------------------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-368
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-368
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: AXIOM
>            Reporter: Rich Scheuerle
>            Assignee: Rich Scheuerle
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Problem:
> There are several serialize methods in the llom and dom implementations that cause excessive wrappering of MTOMXMLStreamWriter objects.  This increases call path and temporary objects.  (Plus it can cause problems because the inner MTOMXMLStreamWriter may have special OMFormat settings that are masked by the outer MTOMXMLStreamWriter).
> Example  Current, Bad Code:
> /**
>      * Serializes the node with caching.
>      *
>      * @param xmlWriter
>      * @throws javax.xml.stream.XMLStreamException
>      *
>      */
>     public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
>         
>        MTOMXMLStreamWriter writer = new MTOMXMLStreamWriter(xmlWriter);
>         internalSerialize(writer);
>         writer.flush();
>     }
> Corrected Code:
> /**
>      * Serializes the node with caching.
>      *
>      * @param xmlWriter
>      * @throws javax.xml.stream.XMLStreamException
>      *
>      */
>     public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException {
>         
>         // If the input xmlWriter is not an MTOMXMLStreamWriter, then wrapper it
>         MTOMXMLStreamWriter writer = xmlWriter instanceof MTOMXMLStreamWriter ?
>                 (MTOMXMLStreamWriter) xmlWriter : 
>                     new MTOMXMLStreamWriter(xmlWriter);
>         internalSerialize(writer);
>         writer.flush();
>     }
> Next Step:
> I am making this change in 4 places in Axiom.  I will commit the change after I complete Axiom and Axis2 testing.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.