|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | 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()
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.
public MatcherConfig getMatcherConfig()
public MailetContext getMailetContext()
public java.lang.String getMatcherInfo()
public java.lang.String getMatcherName()
public void init(MatcherConfig newConfig) throws MailetException
MatcherConfig
- config - the MatcherConfig object that contains
configutation information for this matcherpublic void init() throws MailetException
public void log(java.lang.String message)
msg
- - a String specifying the message to be written to the log filepublic 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 MailetException, javax.mail.MessagingException
mail
- - the Mail object that contains the MimeMessage and
routing information
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |