james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristian Bogdan <cri...@nada.kth.se>
Subject Re: mail processing events?
Date Sat, 14 Sep 2002 08:53:27 GMT
Duh, sorry for not thinking till the end... There is a simpler solution.

Cristian Bogdan wrote:
> I think the easiest and most generic way to support this is to give the 
> possibility to mailet or service programmers to register callbacks for 
> events of this sort:
> - mail x has changed state from a (or nothing, upon creation) to b
> - mail x has been duplicated as y
> - mail x has been renamed as y

This can be implemented with a CustomMailImpl extends MailImpl, or a 
wrapper around a MailImpl. For my app, it's inheritance-based event 
handling but it's easier in this case, since such events are not likely 
to be generally interesting (as I suspected and Danny Angus confirmed)

Since in my service I have control of the Mail creation (before I invoke 
sendMail() like SMTPHandler does), I think I can now go on implementing 
my service without James changes :).

For those who don't have instantiation control, one can think of two 
generic features
- possibility to indicate a MailImplFactory for e.g. SMTPServer.
- possibility to define a wrapper mailet, that decorates the mail with 
the wrapping of its choice (much in the way a filter servlet can 
decorate its request and response), with a MailWrapper convenience class 
and all that.


 > Also instances of
 > MailImpl should be properly setState(ghost) by the processors whenever
 > needed (e.g. when they reach the end of the pipeline without having been
 > ghosted by any mailet).

OK, I just noticed that this is solved lately by adding null mailets at 
the end of the list with LinearProcessor.closeProcesorList()

To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>

View raw message