[jdom-interest] XMLOutputter & currentFormat
rlear at algorithmics.com
Fri Dec 20 11:42:18 PST 2002
XMLFormat is very close to being "thread-friendly" ... I know that JDom does
not attempt thread-safeness, but hear me out.
Once XMLOutputter is instantiated, and the defaultFormatter is set, then the
"output" methods can be called any number of times concurrently without
breaking things ... except for the "currentFormat". This may be changed if
an Element has a "space" attribute.
The currentFormat is stored as an instance variable, and thus, if the data
in one thread changes the current format, then all threads will take on the
This is relatively easily corrected by having the format cascade down the
element tree as the XML Is output.
This will/may break objects which extend the XMLOutputter....
XMLOutputter needs only one instance per Format permutation, instead of
one instance per thread.
Break classes which extend XMLOutputter (none in JDom, but may be
XMLOutputter is relatively "light" anyway, and the memory saved would be
I have a patch available which makes the above change, and I have been using
Are attachments permitted on this list?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the jdom-interest