Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-72

Provide a means to dispose a Message

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.5
    • 0.5
    • None
    • None

    Description

      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 problem.

      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.

      Attachments

        1. mime4j-dispose-visitor.patch
          30 kB
          Markus Wiederkehr
        2. mime4j-dispose-no-clutter.patch
          12 kB
          Markus Wiederkehr
        3. mime4j-dispose-finalize.patch
          17 kB
          Markus Wiederkehr
        4. mime4j-disposable.patch
          5 kB
          Markus Wiederkehr
        5. mime4j-bodywalker-disposable.patch
          22 kB
          Oleg Kalnichevski

        Activity

          People

            robertburrelldonkin Robert Burrell Donkin
            wmax Markus Wiederkehr
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: