I have endpoint declared in Spring as follows:
<entry key="mtom-enabled" value="true" />
During tests I discovered, that large attachments (>64k), which are saved in temporary files, are not removed after processing SOAP message.
I've analysed sources of org.apache.cxf.attachment.AttachmentDataSource and org.apache.cxf.io.CachedOutputStream and discovered that AttachmentDataSource does not allow to close cache.
The only solution is to add close() method to AttachmentDataSource and close cache manually.