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
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]