| java.lang.Object org.apache.mailet.GenericMailet
All known Subclasses: org.apache.james.transport.mailets.Null, org.apache.james.transport.mailets.smime.SMIMEDecrypt, org.apache.james.transport.mailets.AbstractAddFooter, org.apache.james.transport.mailets.PostmasterAlias, org.apache.james.transport.mailets.ServerTime, org.apache.james.transport.mailets.CommandListservManager, org.apache.james.transport.mailets.SetMimeHeader, org.apache.james.transport.mailets.GenericListservManager, org.apache.james.transport.mailets.JDBCAlias, org.apache.james.transport.mailets.LocalDelivery, org.apache.james.transport.mailets.FromRepository, org.apache.james.transport.mailets.MailetLoaderTestMailet, org.apache.james.transport.mailets.UsersRepositoryAliasingForwarding, org.apache.james.transport.mailets.ToProcessor, org.apache.james.transport.mailets.debug.Identity, org.apache.james.transport.mailets.GenericListserv, org.apache.james.transport.mailets.smime.SMIMECheckSignature, org.apache.james.transport.mailets.AbstractVirtualUserTable, org.apache.james.transport.mailets.debug.ExceptionThrowingMailet, org.apache.james.transport.mailets.RemoveMailAttribute, org.apache.james.transport.mailets.debug.Counter, org.apache.james.transport.mailets.AbstractRedirect, org.apache.james.transport.mailets.debug.DumpSystemErr, org.apache.james.transport.mailets.WhiteListManager, org.apache.james.transport.mailets.BayesianAnalysisFeeder, org.apache.james.transport.mailets.BayesianAnalysis, org.apache.james.transport.mailets.RemoteDelivery, org.apache.james.transport.mailets.ToRepository, org.apache.james.transport.mailets.CommandListservProcessor, org.apache.james.transport.mailets.ClamAVScan, org.apache.james.transport.mailets.AddHabeasWarrantMark, org.apache.james.transport.mailets.UseHeaderRecipients, org.apache.james.transport.mailets.smime.SMIMEAbstractSign, org.apache.james.transport.mailets.SetMailAttribute, org.apache.james.transport.mailets.RemoveAllMailAttributes, org.apache.james.transport.mailets.LogMessage, org.apache.james.transport.mailets.ToMultiRepository,
GenericMailet | abstract public class GenericMailet implements Mailet,MailetConfig(Code) | | GenericMailet makes writing mailets easier. It provides simple
versions of the lifecycle methods init and destroy and of the methods
in the MailetConfig interface. GenericMailet also implements the log
method, declared in the MailetContext interface.
To write a generic mailet, you need only override the abstract service
method.
version: 1.0.0, 24/04/1999 |
Method Summary | |
public void | destroy() Called by the mailer container to indicate to a mailet that the
mailet is being taken out of service. | public String | getInitParameter(String name) Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
This method is supplied for convenience. | public String | getInitParameter(String name, String defValue) Returns a String containing the value of the named initialization
parameter, or defValue if the parameter does not exist.
This method is supplied for convenience. | public Iterator | getInitParameterNames() Returns the names of the mailet's initialization parameters as an
Iterator of String objects, or an empty Iterator if the mailet has no
initialization parameters.
This method is supplied for convenience. | public MailetConfig | getMailetConfig() Returns this Mailet's MailetConfig object. | public MailetContext | getMailetContext() Returns a reference to the MailetContext in which this mailet is
running. | public String | getMailetInfo() Returns information about the mailet, such as author, version, and
copyright. | public String | getMailetName() Returns the name of this mailet instance. | public void | init(MailetConfig newConfig) Called by the mailet container to indicate to a mailet that the
mailet is being placed into service.
This implementation stores the MailetConfig object it receives from
the mailet container for later use. | public void | init() A convenience method which can be overridden so that there's no
need to call super.init(config).
Instead of overriding init(MailetConfig), simply override this
method and it will be called by GenericMailet.init(MailetConfig config). | public void | log(String message) Writes the specified message to a mailet log file, prepended by
the mailet's name. | public void | log(String message, Throwable t) Writes an explanatory message and a stack trace for a given Throwable
exception to the mailet log file, prepended by the mailet's name. | abstract public void | service(Mail mail) |
destroy | public void destroy()(Code) | | Called by the mailer container to indicate to a mailet that the
mailet is being taken out of service.
|
getInitParameter | public String getInitParameter(String name)(Code) | | Returns a String containing the value of the named initialization
parameter, or null if the parameter does not exist.
This method is supplied for convenience. It gets the value of the
named parameter from the mailet's MailetConfig object.
Parameters: name - - a String specifying the name of the initialization parameter a String containing the value of the initalization parameter |
getInitParameter | public String getInitParameter(String name, String defValue)(Code) | | Returns a String containing the value of the named initialization
parameter, or defValue if the parameter does not exist.
This method is supplied for convenience. It gets the value of the
named parameter from the mailet's MailetConfig object.
Parameters: name - - a String specifying the name of the initialization parameter Parameters: defValue - - a String specifying the default value when the parameteris not present a String containing the value of the initalization parameter |
getInitParameterNames | public Iterator getInitParameterNames()(Code) | | Returns the names of the mailet's initialization parameters as an
Iterator of String objects, or an empty Iterator if the mailet has no
initialization parameters.
This method is supplied for convenience. It gets the parameter names from
the mailet's MailetConfig object.
an Iterator of String objects containing the names ofthe mailet's initialization parameters |
getMailetConfig | public MailetConfig getMailetConfig()(Code) | | Returns this Mailet's MailetConfig object.
the MailetConfig object that initialized this mailet |
getMailetContext | public MailetContext getMailetContext()(Code) | | Returns a reference to the MailetContext in which this mailet is
running.
the MailetContext object passed to this mailet by the init method |
getMailetInfo | public String getMailetInfo()(Code) | | Returns information about the mailet, such as author, version, and
copyright. By default, this method returns an empty string. Override
this method to have it return a meaningful value.
information about this mailet, by default an empty string |
getMailetName | public String getMailetName()(Code) | | Returns the name of this mailet instance.
the name of this mailet instance |
init | public void init(MailetConfig newConfig) throws MessagingException(Code) | | Called by the mailet container to indicate to a mailet that the
mailet is being placed into service.
This implementation stores the MailetConfig object it receives from
the mailet container for later use. When overriding this form of the
method, call super.init(config).
Parameters: MailetConfig - newconfig - the MailetConfig object that containsconfigutation information for this mailet throws: MessagingException - if an exception occurs that interrupts the mailet's normal operation |
init | public void init() throws MessagingException(Code) | | A convenience method which can be overridden so that there's no
need to call super.init(config).
Instead of overriding init(MailetConfig), simply override this
method and it will be called by GenericMailet.init(MailetConfig config).
The MailetConfig object can still be retrieved via getMailetConfig().
throws: MessagingException - if an exception occurs that interrupts the mailet's normal operation |
log | public void log(String message)(Code) | | Writes the specified message to a mailet log file, prepended by
the mailet's name.
Parameters: message - - a String specifying the message to be written to the log file |
log | public void log(String message, Throwable t)(Code) | | Writes an explanatory message and a stack trace for a given Throwable
exception to the mailet log file, prepended by the mailet's name.
Parameters: message - - a String that describes the error or exception Parameters: t - - the java.lang.Throwable to be logged |
service | abstract public void service(Mail mail) throws javax.mail.MessagingException(Code) | | Called by the mailet container to allow the mailet to process a
message.
This method is declared abstract so subclasses must override it.
Parameters: mail - - the Mail object that contains the MimeMessage androuting information throws: javax.mail.MessagingException - - if an exception occurs that interferes with the mailet's normal operation |
|
|