7 Replies Latest reply on Mar 18, 2005 3:13 AM by Michael Barker

    MailListeners and Beanshells

    Andrew Oliver Master

      The beanshell or javascript thing will be one MailListener which may or may not route things to other maillisteners. You'll not be obligated to use it. I do however want some deployment semantics around it (meaning the abillity to deploy new mail beanshell/javascript scripts for routing/processing/eliminating mail).

      Selective matching of mail listeners. An example of this is the James matchers/selectors/etc. They are for conditionally applying workers in a chain of command pattern (Basically a mix of the reactor pattern and chain of command pattern). We may indeed implement something very like this but for the next several milestones, I intend to keep a single simple (easy to debug) chain rather than a branched chain. I'm also not 100% sold on a branched chain being implicitly supported rather than explicitly.

      Meaning I may opt for special MailListeners that take the chain of mail listeners and then apply conditions to the mail listeners that they contain rather than support matching/selecting in the core framework itself. (In fact I'm nearly positive that I'll do this) Basically a kind of combination of the chain of command and composite pattern in which the composite object happens to itself impelement a combination of the chain of command and reactor pattern (similar to the behavior in james).

      What we need to do right now is start enhancing Mail.java to provide more robust features for altering/reading/searching/matching headers. I'd also like to see some thoughts on how a MailListener which can perform operations on said Mail and other things like chain termination. Eventually it should provide imperative modes of maillistener chain aggregation.

      I have some inklings to use AOP for security and it might be possible to use AOP to implement the chain but I'm resistent to the idea as a generic construct. Thoughts (from code contributors/developers or active users only please)?