|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.mailet.GenericMatcher
GenericMatcher implements the Matcher and MatcherConfig interfaces. GenericMatcher makes writing matchers easier. It provides simple versions of the lifecycle methods init and destroy and of the methods in the MatcherConfig interface. GenericMatcher also implements the log method, declared in the MatcherContext interface.
To write a generic matcher, you need only override the abstract match method.
Constructor Summary | |
GenericMatcher()
|
Method Summary | |
void |
destroy()
Called by the mailet container to indicate to a matcher that the matcher is being taken out of service. |
java.lang.String |
getCondition()
Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist. |
MailetContext |
getMailetContext()
Returns a reference to the MailetContext in which this matcher is running. |
MatcherConfig |
getMatcherConfig()
Returns this matcher's MatcherConfig object. |
java.lang.String |
getMatcherInfo()
Returns information about the matcher, such as author, version, and copyright. |
java.lang.String |
getMatcherName()
Returns the name of this matcher instance. |
void |
init()
A convenience method which can be overridden so that there's no need to call super.init(config). |
void |
init(MatcherConfig newConfig)
Called by the matcher container to indicate to a matcher that the matcher is being placed into service. |
void |
log(java.lang.String message)
Writes the specified message to a matcher log file, prepended by the matcher's name. |
void |
log(java.lang.String message,
java.lang.Throwable t)
Writes an explanatory message and a stack trace for a given Throwable exception to the matcher log file, prepended by the matcher's name. |
abstract java.util.Collection |
match(Mail mail)
Called by the matcher container to allow the matcher to process a message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GenericMatcher()
Method Detail |
public void destroy()
destroy
in interface Matcher
public java.lang.String getCondition()
This method is supplied for convenience. It gets the value of the named parameter from the matcher's MatcherConfig object.
getCondition
in interface MatcherConfig
public MatcherConfig getMatcherConfig()
getMatcherConfig
in interface Matcher
public MailetContext getMailetContext()
getMailetContext
in interface MatcherConfig
public java.lang.String getMatcherInfo()
getMatcherInfo
in interface Matcher
public java.lang.String getMatcherName()
getMatcherName
in interface MatcherConfig
public void init(MatcherConfig newConfig) throws javax.mail.MessagingException
init
in interface Matcher
newConfig
- - a MatcherConfig object containing the matcher's configuration
and initialization parameters
javax.mail.MessagingException
- if an exception occurs that interrupts the matcher's normal operation
javax.mail.MessagingException
- - if an exception has occurred that
interferes with the matcher's normal operationpublic void init() throws javax.mail.MessagingException
MatcherException
- if an exception occurs that interrupts the matcher's normal operation
javax.mail.MessagingException
public void log(java.lang.String message)
public void log(java.lang.String message, java.lang.Throwable t)
message
- - a String that describes the error or exceptiont
- - the java.lang.Throwable error or exceptionpublic abstract java.util.Collection match(Mail mail) throws javax.mail.MessagingException
match
in interface Matcher
mail
- - the Mail object that contains the MimeMessage and
routing information
javax.mail.MessagingException
- - if an exception occurs that interferes with the mailet's normal operation
occurred
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |