You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2002/06/03 07:02:41 UTC

Matcher -> Mailet communication

Serge and Danny,

Generically, how would you recommend one do something based upon the
specific result of a match? Is there any good way for a matcher to
communicate data to a mailet?  I can't see how the matcher can pass info
related to the match to a mailet, other than by adding headers to the
MimeMessage.

For some things I want to do, I suppose I could call message.setHeader() in
the matcher (since adding the header is actually the action I want to take),
but that doesn't feel right, especially in the general case.

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Matcher -> Mailet communication

Posted by Serge Knystautas <se...@lokitech.com>.
No way right now aside from adding/changing a header.  If that's 
ultimately what you want to do, seems like you've got your answer. :)
-- 
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com/

Noel J. Bergman wrote:
> Serge and Danny,
> 
> Generically, how would you recommend one do something based upon the
> specific result of a match? Is there any good way for a matcher to
> communicate data to a mailet?  I can't see how the matcher can pass info
> related to the match to a mailet, other than by adding headers to the
> MimeMessage.
> 
> For some things I want to do, I suppose I could call message.setHeader() in
> the matcher (since adding the header is actually the action I want to take),
> but that doesn't feel right, especially in the general case.
> 
> 	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Matcher -> Mailet communication

Posted by Serge Knystautas <se...@lokitech.com>.
 From the way other APIs are written, attributes imply support for 
serializable objects while properties implies just Strings.  That's why 
I suggested get/setAttribute.

This is also another reason to add this because you couldn't stick 
serializable objects in MimeMessage headers like you could properties.
-- 
Serge Knystautas
Loki Technologies - Unstoppable Websites
http://www.lokitech.com

Noel J. Bergman wrote:
>>>I can't see how the matcher can pass info related to the match
>>>to a mailet, other than by adding headers to the MimeMessage.
>>
> 
>>The two (minor) changes I have on tap for the next version of the
>>mailet API are adding attributes to Mail objects
> 
> 
> :-) Thank you, Serge.  That's exactly what I had in mind.  I presume that
> this would be:
> 
> 	void setAttribute(String, Object)
> 	Object getAttribute(String)
> 
> or something similar?  The only coupling between Matchers and Mailets would
> be the name (and content) of the properties (I don't care if we use
> set/getAttribute or set/getProperty ... anyone else care?).
> 
> 	--- Noel
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Matcher -> Mailet communication

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > I can't see how the matcher can pass info related to the match
> > to a mailet, other than by adding headers to the MimeMessage.

> The two (minor) changes I have on tap for the next version of the
> mailet API are adding attributes to Mail objects

:-) Thank you, Serge.  That's exactly what I had in mind.  I presume that
this would be:

	void setAttribute(String, Object)
	Object getAttribute(String)

or something similar?  The only coupling between Matchers and Mailets would
be the name (and content) of the properties (I don't care if we use
set/getAttribute or set/getProperty ... anyone else care?).

	--- Noel


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>