org.apache.mailet.base
Class MatcherInverter

java.lang.Object
  extended by org.apache.mailet.base.MatcherInverter
All Implemented Interfaces:
Matcher

public class MatcherInverter
extends Object
implements Matcher

This class can be used as a wrapper for getting the "not matched" recipients


Constructor Summary
MatcherInverter(Matcher wrappedMatcher)
           
 
Method Summary
 void destroy()
          Destroys this Matcher.
 MatcherConfig getMatcherConfig()
          Returns a MatcherConfig object, which provides initialization parameters and a MailetContext through which it can interact with the mailet container.
 String getMatcherInfo()
          Returns information about the matcher, such as author, version and copyright.
 void init(MatcherConfig config)
          Initializes this Matcher.
 Collection<MailAddress> match(Mail mail)
          Return a Collection of "not matched" recipients
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatcherInverter

public MatcherInverter(Matcher wrappedMatcher)
Method Detail

destroy

public void destroy()
Description copied from interface: Matcher
Destroys this Matcher.

This method is called only once, after all Matcher.match(org.apache.mailet.Mail) invocations have completed (or a timeout period has elapsed). After this method returns, this Matcher will no longer be used.

Implementations should use this method to release any resources that are being held (such as memory, file handles or threads) and make sure that any persistent information is properly stored.

Note that containers SHOULD NOT invoke this method before Matcher.init(MatcherConfig) has been successfully completed.

Specified by:
destroy in interface Matcher
See Also:
Matcher.destroy()

getMatcherConfig

public MatcherConfig getMatcherConfig()
Description copied from interface: Matcher
Returns a MatcherConfig object, which provides initialization parameters and a MailetContext through which it can interact with the mailet container.

Implementations of this interface are responsible for storing the MatcherConfig which they receive in the Matcher.init(org.apache.mailet.MatcherConfig) method so that this method can return it.

Specified by:
getMatcherConfig in interface Matcher
Returns:
the MatcherConfig that this matcher was initialized with
See Also:
Matcher.getMatcherConfig()

getMatcherInfo

public String getMatcherInfo()
Description copied from interface: Matcher
Returns information about the matcher, such as author, version and copyright.

Specified by:
getMatcherInfo in interface Matcher
Returns:
the Mailet information (as a plain text string)
See Also:
Matcher.getMatcherInfo()

init

public void init(MatcherConfig config)
          throws javax.mail.MessagingException
Description copied from interface: Matcher
Initializes this Matcher.

This method is called only once, and must complete successfully before the Matcher.match(org.apache.mailet.Mail) method can be invoked.

Specified by:
init in interface Matcher
Parameters:
config - a MatcherConfig containing the matcher's configuration and initialization parameters
Throws:
javax.mail.MessagingException - if an error occurs
See Also:
Matcher.destroy()

match

public Collection<MailAddress> match(Mail mail)
                              throws javax.mail.MessagingException
Return a Collection of "not matched" recipients

Specified by:
match in interface Matcher
Parameters:
mail - the Mail to match
Returns:
the recipients that meet the match criteria as a Collection of String objects
Throws:
javax.mail.MessagingException - if any error occurs which prevents the Mail matching from completing successfully


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.