axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akitoshi Yoshida <>
Subject Axis's AttachmentsImpl.writeContentToStream automatically deletes ManagedMemoryDataSource
Date Fri, 07 Aug 2009 13:08:26 GMT
I couldn't find the answer to the following question in JIRA nor in
the mail archive.

Axis's AttachmentsImpl.writeContentToStream always automatically
delete the associated instances of ManagedMemoryDataSources.
This prevents from a message to be written to somewhere twice when one
of the attachments was instantiated using ManagedMemoryDataSource.

AttachmentsImpl has the dispose() method that can explicitly dispose
the attachments. And this dispose method will get called automatically
when the conainer mesage goes out of scope.
So I don't know why the above write method must automatically delete
the managed memory data sources.
Even if some use case requires such an automatic disposal after
writing, there should be an option to keep the attachments after
writing so that the message can be written out more than once.

Currently, to avoid this problem, we need to swap the data handler
before writing out or use a local AttachmentsImpl implementation that
does not delete the data sources after writing out.

Could some experts comment on this issue?

Thank you in adavance.

Regards, akiy

View raw message