On 21/11/2007, Tim Stephenson <[EMAIL PROTECTED]> wrote:
> Has anyone ever asked for or considered allowing more than one matcher
> per mailet?

Yes, we have considered it for inclusion in the next generation of the API.

> a more elegant solution would appear to be to support more than one
> matcher per mailet, how feasible is that? Any pointers to where i
> should be looking to implement this would also be appreciated.

You have three choices here

1/ implement a matcher which takes as its argument a script of some
sort, I've always thought that javascript using rhino
(http://www.mozilla.org/rhino/) would be easy, you can just expose the
Mail as an object to the javascript, and the script would traverse the
mail much like a script in a browser traverses the DOM. Its
surprisingly easy to use rhino to expose scriptable objects and run
scripts against them once you get over the initial learning curve.
Your matcher would have an object which would contain a property for
the response and a property for the Mail and expose this to the
script, the script would look at the Mail and update the response.
When it finished the matcher would return the response from the
scripted object.

or

2/ change the way James reads the mailet configuration and assembles
the pipeline. Possibly not for the faint hearted.

or

3/ use jseive instead

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to