james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <server-...@james.apache.org>
Subject [jira] Commented: (MIME4J-72) Provide a means to dispose a Message
Date Thu, 09 Oct 2008 21:58:44 GMT

    [ https://issues.apache.org/jira/browse/MIME4J-72?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12638407#action_12638407

Oleg Kalnichevski commented on MIME4J-72:


There is a lot of points to discuss and to disagree about. Let me mention the most important
ones for now. My main reservation about the API changes you are proposing is that they go
counter to the principle of separation of concerns. (1) Intermediate storage, disposal of
temporary resources, sophisticated object coping are _implementation_ aspects that ideally
should not pollute Message / Entity / Body API, which is meant to be _generic_. Ideally they
should be handled separately without over-complicating the generic API. (2) I also cannot
fully agree that it is the visitor concern to decide what objects to visit. It breaks a common
pattern and just does not seem right.

Please do not feel discouraged. Disagreements are very common on this list. I and Stefan sometimes
spend _weeks_ disagreeing :-/


Here's my suggestion. I would like to commit my version of the patch _for now_. It addresses
the concerns raised by Bernd (which I fully share) while still allowing to take care of resource
deallocation and message cloning Markus needs, albeit with a bit of extra coding.

Let's get 0.5 released rather sooner than later and then carefully consider further improvements
without the pressure of holding back a much needed release. 

> Provide a means to dispose a Message
> ------------------------------------
>                 Key: MIME4J-72
>                 URL: https://issues.apache.org/jira/browse/MIME4J-72
>             Project: JAMES Mime4j
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Markus Wiederkehr
>            Assignee: Robert Burrell Donkin
>         Attachments: entityvisitor.patch, mime4j-disposable.patch, mime4j-dispose-finalize.patch,
mime4j-dispose-no-clutter.patch, mime4j-dispose-visitor.patch
> Currently an org.apache.james.mime4j.message.Message uses temporary files to store text
and binary attachments of the message. Unfortunately a Message cannot be disposed of explicitly.
Even when it eventually gets garbage collected the temp files continue to exist until the
VM exits.
> If the VM runs for a long time and a lot of e-mails get processed this can become a major
> For this reason I think that class Entity and interface Body should both have a method
to dispose of the object. Multipart should dispatch a dispose-call to its list of body parts.
A BodyPart should dispose of its body and concrete Body implementation such as TempFileTextBody
should ultimately invoke delete() on the backing TempFile.
> Last but not least SimpleTempStorage$SimpleTempFile should not silently ignore delete-calls.

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: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message