axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <>
Subject cleanup of attachment files &c
Date Sun, 12 Jan 2003 05:13:57 GMT

I want to look at attachement deletion and other cleanup. Here is roughly my

-add package axis.housekeeping for all such stuff
-add interface Disposable { void dispose(); }  for all disposable objects
-add class DisposalList that adds, remove and disposes of Disposable
objects. (and demand creates the inner list)
-Add class FileDisposer() that disposes of named files

This much I've just done, but not committed.

So now I need to integrate the attachements with this. How does this sound:-

-add a DisposalList with get accessor to MessageContext

-add MessageContext.dispose()  to hand off to DisposalList.dispose()

-When attachments are created from reading a stream, we add them to the
disposal list of the current message context (assuming there is a current
message context).

-modify the transports to
  dispose() the message context used in the message
  set the current message context to null (encourage GC)
(this could factored into an AxisEngine.disposeCurrentMessageContext()

Now, consequences of this action would be that files wont outlast a message.
So recipients have to save stuff -but they would have to do this for small
messages. The other consequence is that some of the attachmentInputStream
classes have to get the current message context and manipulate it, which
kind of violates my sensibilities; low level classes shouldnt need such
knowledge. But the only other solutions are
    (a) static method in class in housekeeping to add disposables to current
context . I'd probably do that anyway for cleanness, but the context is
still there, hidden.
    (b) pass a DisposalList down for Attachment classes to add disposables
to. This is cleanest, most fundamental.

Thoughts? Hold off till Axis1.1 ships?


View raw message