|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.GenericServer SK.gnome.dwarf.thread.ThreadServer SK.gnome.dwarf.mail.smtp.proc.MailAgent SK.gnome.dwarf.mail.smtp.proc.MailAgentServer
Provides container for mail agents.
This special mail agent provides a container for grouping other mail agents together. Its processing methods call the contained agents' corresponding methods in order the agents were added to the container.
If a contained agent's MailAgent.isRequired()
method returns true and such agent throws an
exception while processing the message, the processing chain is interrupted and the message is
immediatelly returned to the mail queue with the filtered recipients marked as failed/rejected.
If the given agent is not required, the exception is logged and processing continues further
in the agent chain.
Field Summary |
Fields inherited from class SK.gnome.dwarf.mail.smtp.proc.MailAgent |
context, required |
Fields inherited from class SK.gnome.dwarf.thread.ThreadServer |
daemon, thread |
Fields inherited from class SK.gnome.dwarf.GenericService |
initParameters, parent |
Fields inherited from interface SK.gnome.dwarf.Service |
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED |
Constructor Summary | |
MailAgentServer(java.lang.String name)
Creates a new MailAgentServer. |
Method Summary | |
void |
destroy()
Destroys the agent. |
void |
init(MailAgentContext context)
Initializes the agent. |
void |
postprocess(MailAgentMessage message,
java.util.Collection recipients)
Processes the message. |
void |
preprocess(MailAgentMessage message,
java.util.Collection recipients)
Processes the message. |
Methods inherited from class SK.gnome.dwarf.mail.smtp.proc.MailAgent |
filter, init, isRequired, setRequired, storeMessage |
Methods inherited from class SK.gnome.dwarf.thread.ThreadServer |
enableThread, finish, loop, run, setDaemon, shutdown, start, stop |
Methods inherited from class SK.gnome.dwarf.GenericServer |
addService, addService, getAuthenticator, getLogger, getParameters, getService, getServices, getServices, removeService, report |
Methods inherited from class SK.gnome.dwarf.GenericService |
getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getName, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface SK.gnome.dwarf.Service |
getFullName, getName, getState, log, log, login, logout |
Constructor Detail |
public MailAgentServer(java.lang.String name)
name
- the agent nameMethod Detail |
public void init(MailAgentContext context) throws MailException
Initializes the contained MailAgent
instances in order they were added
to this service.
init
in class MailAgent
context
- the mail context associated with this agent
MailException
- if an error occuredpublic void destroy() throws MailException
Destroys the contained MailAgent
instances in order they were added
to this service.
destroy
in class MailAgent
MailException
- if an error occuredpublic void preprocess(MailAgentMessage message, java.util.Collection recipients) throws java.io.IOException, MailException
MailAgent
This method is called on the agent only once for each message, just after it has arrived
to the mail queue. In order to let this happen, the agent must implement the Preprocessing
interface.
The recipients argument is a collection of Recipient
objects representing the message recipients, as returned after processing by the mail filter
chain. This collection is always non-empty.
preprocess
in class MailAgent
message
- the queued messagerecipients
- collection of recipients
MailException
- if an error occured
java.io.IOException
- if an I/O error occuredpublic void postprocess(MailAgentMessage message, java.util.Collection recipients) throws java.io.IOException, MailException
MailAgent
This method is called on the agent several times for each message, as it is successively
delivered to the particular recipients. In order to let this happen, the agent must implement
the Postprocessing
interface.
The recipients argument is a collection of Recipient
objects representing the message recipients, as returned after processing by the mail filter
chain. This collection is always non-empty, and contains only those recipients, for which the
actual delivery process succeded (or failed).
postprocess
in class MailAgent
message
- the queued messagerecipients
- collection of recipients
MailException
- if an error occured
java.io.IOException
- if an I/O error occured
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |