james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rauno Palosaari" <ra...@rauno.com>
Subject Getting mailet attributes from a Matcher
Date Tue, 27 Nov 2001 10:50:10 GMT
Hi all.

Is it possible to get mailet-parameters from a Matcher, I wrote a matcher and a mailet:
(assembly.xml)
<mailet match="IsCustomer" class="DoStuff">
     <connection>jdbc:mysql:///whatever</connection>
     <username>user</username>
     <password>something</password>
     <query>select domain from customer</query>
</mailet>

(What I want to do is to get the Matcher conditions from a db.)

DoStuff.java (mailet) has no problems getting connection, username, etc.
I want to access the parameters from my matcher as well.
getMatcherConfig().getMailetContext().getAttribute("connection"); doesn't do the job unless
somebody sets the attribute first, I guess.

Is there any way around this, i.e. other than passing the parameters in the matcher condition
part (well, it does the job but it's ugly): 
<mailet match="IsCustomer=jdbc:mysql:///whatever,user,something,select domain from customer"
class="DoStuff">
</mailet>

Regards,
Rauno

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message