You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by sundeep Gelli <su...@picmond.com> on 2006/01/28 02:59:25 UTC

Matcher priority

Hi,

 How can i assign priority to the matchers?I need to implement one matcher and if it fails i need to execute the other.Will the matchers execute in the order in which they appear?
In my config.xml,if one of my matchers return success,i am assigning it to null i.e  dont want to execute the mail anymore.But all the other matchers were also checked.
Why is this happening?Please help

Regards 
Sundeep

Re: Matcher priority

Posted by Stefano Bagnara <ap...@bago.org>.
sundeep Gelli wrote:
> Hi,
> 
> In my config.xml in the root processor,i included a matcher.If that returns
> success i am executing the mailet which sets the mail to ghost as u said.But
> my problem is the second matcher is executing first and then the first
> one.Why is this happening?
> Am  i including them in the right processor?
> Thanx and regards
> Sundeep

Post your config.xml and your mailet sourcecode.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Matcher priority

Posted by sundeep Gelli <su...@picmond.com>.
Hi,

In my config.xml in the root processor,i included a matcher.If that returns
success i am executing the mailet which sets the mail to ghost as u said.But
my problem is the second matcher is executing first and then the first
one.Why is this happening?
Am  i including them in the right processor?
Thanx and regards
Sundeep


----- Original Message ----- 
From: "Stefano Bagnara" <ap...@bago.org>
To: "James Users List" <se...@james.apache.org>
Sent: Monday, January 30, 2006 1:15 AM
Subject: Re: Matcher priority


> sundeep Gelli wrote:
> > Hi,
> >
> >  How can i assign priority to the matchers?I need to implement one
matcher and if it fails i need to execute the other.Will the matchers
execute in the order in which they appear?
>
> James execute matchers inside a processor in the same order you write
them.
> When a matcher matches the message then the associated mailet is
> executed. The mailet can stop the message or let it being processed from
> the following matcher. The mailet decide this by setting the "state"
> field of the Mail. Use Mail.GHOST to stop the message, while
> "processorname" to move the messsage to another processor.
>
> Many mailets support the <passThrough> option to alter the default
> behaviour. Using <passThrough>true</passThrough> the mail will be
> processed by the following matchers.
>
> > In my config.xml,if one of my matchers return success,i am assigning it
to null i.e  dont want to execute the mail anymore.But all the other
matchers were also checked.
>
> Assigning an input parameter to null in Java does not put null in the
> object, this is a Java foundation.
>
> You have to call mail.setState(Mail.GHOST) if you want to "eat" the
message.
>
> Stefano
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: Matcher priority

Posted by Stefano Bagnara <ap...@bago.org>.
sundeep Gelli wrote:
> Hi,
> 
>  How can i assign priority to the matchers?I need to implement one matcher and if it fails i need to execute the other.Will the matchers execute in the order in which they appear?

James execute matchers inside a processor in the same order you write them.
When a matcher matches the message then the associated mailet is 
executed. The mailet can stop the message or let it being processed from 
the following matcher. The mailet decide this by setting the "state" 
field of the Mail. Use Mail.GHOST to stop the message, while 
"processorname" to move the messsage to another processor.

Many mailets support the <passThrough> option to alter the default 
behaviour. Using <passThrough>true</passThrough> the mail will be 
processed by the following matchers.

> In my config.xml,if one of my matchers return success,i am assigning it to null i.e  dont want to execute the mail anymore.But all the other matchers were also checked.

Assigning an input parameter to null in Java does not put null in the 
object, this is a Java foundation.

You have to call mail.setState(Mail.GHOST) if you want to "eat" the message.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org