Methods Summary |
---|
public void | destroy()Called by the mailer container to indicate to a mailet that the
mailet is being taken out of service.
//Do nothing
|
public java.lang.String | getInitParameter(java.lang.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. It gets the value of the
named parameter from the mailet's MailetConfig object.
return config.getInitParameter(name);
|
public java.lang.String | getInitParameter(java.lang.String name, java.lang.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. It gets the value of the
named parameter from the mailet's MailetConfig object.
String res = config.getInitParameter(name);
if (res == null) {
return defValue;
} else {
return res;
}
|
public java.util.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. It gets the parameter names from
the mailet's MailetConfig object.
return config.getInitParameterNames();
|
public MailetConfig | getMailetConfig()Returns this Mailet's MailetConfig object.
return config;
|
public MailetContext | getMailetContext()Returns a reference to the MailetContext in which this mailet is
running.
return getMailetConfig().getMailetContext();
|
public java.lang.String | getMailetInfo()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.
return "";
|
public java.lang.String | getMailetName()Returns the name of this mailet instance.
return config.getMailetName();
|
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).
The MailetConfig object can still be retrieved via getMailetConfig().
//Do nothing... can be overriden
|
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. When overriding this form of the
method, call super.init(config).
config = newConfig;
init();
|
public void | log(java.lang.String message)Writes the specified message to a mailet log file, prepended by
the mailet's name.
StringBuffer logBuffer =
new StringBuffer(256)
.append(getMailetName())
.append(": ")
.append(message);
getMailetContext().log(logBuffer.toString());
|
public 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 mailet log file, prepended by the mailet's name.
StringBuffer logBuffer =
new StringBuffer(256)
.append(config.getMailetName())
.append(": ")
.append(message);
getMailetContext().log(logBuffer.toString(), t);
|
public abstract void | service(Mail mail)Called by the mailet container to allow the mailet to process a
message.
This method is declared abstract so subclasses must override it.
|