Paul Sandoz wrote:
> This recycling is related to the same issue for the FI StAX parsers.
>
> I have not looked deeply at the code but it looks like the right place
> to support the recycling of XML *and* FI XMLStreamReader instances.
Yeah, we can do that. The easiet way is to have FI's XMLStreamReader
implement RecycleAware. If needed we can move this interface on stax-ex
to do this.
> I am wondering if it is possible to also recycle stream buffers i.e.
> when the message is no longer used.
I think we should first check if it's indeed costly. So far, it doesn't
seem like this is a big enough problem. Pooling has its own overhead and
problems, too.
Finding out when a Message is no longer in use is harder than finding
that out for XMLStreamReader, so doing this is more work. We need
benefits that justify this work.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com