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 2007/09/04 21:58:45 UTC

[jira] Commented: (WSCOMMONS-240) Add a close method to OMNode

    [ https://issues.apache.org/jira/browse/WSCOMMONS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524847 ] 

Rich Scheuerle commented on WSCOMMONS-240:
------------------------------------------

Good ideas.

Some users of Axiom (such as Raymond) only view the OM data via the "Data Model" interfaces.
They don't need to query the underlying builder/parser code, but they do want to indicate that they are "done".

Having a close(boolean) convenience method on OMNode will make it easier for these users to interact with Axiom without
exposing them to other layers of complexity.

I will volunteer to make the changes.

Thanks,
Rich

> Add a close method to OMNode
> ----------------------------
>
>                 Key: WSCOMMONS-240
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-240
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Raymond Feng
>            Assignee: Rich Scheuerle
>
> We're experiencing some memory leaks in AXIOM with some implementations of XML StAX parsers. The main reason is that when an OM tree is backed by a builder or parser, we don't have an API at OM level to release the underlying resources.
> As a user of OM, there are threee cases:
> 1. Immediately close the builder/parser if one exists 
> 2. Build the subtree and then close the parser
> 3. Build the entire document and then close the parser
> OMNode already has a method to build itself and its subtree (OMNode.build()).
> Given this information and OM terminology, perhaps the following makes sense.
> /**
>   * Close and remove the builder and parser of the OMNode if they exist.
>   * @param build.  If true the subtree is built prior to closing the builder and parser.
>   */
> public void close(boolean build);
> This would satisfy (1) and (2).
> Then if someone needed (3) they can always traverse up to the OMDocument and call close(true).
> Does it make sense? Please advise me a better approach otherwise.
> Thanks,
> Raymond

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org