org.cid.distribution
Interface MessageHandler

All Known Implementing Classes:
DataCombinatorHandler, DistributionNode, ListCombinatorHandler, MailEditorHandler, MailWriterHandler, MessageCreatorHandler, MessageHandlerBase, PassthroughHandler, POP3Handler, ScriptingHandler, SMTPHandler

public interface MessageHandler

A message handler is used to process, generate or fetch messages.

A handler instance may not be thread-safe, as their lifecycle is controlled by the Distribution container.

handlers thread-safe.

Version:
$Revision: 173 $

Method Summary
 void destroy()
          The distribution container calls this method on all handlers before finishing the distribution process, allowing them to clean up resources.
 java.lang.String getId()
          The handler Id.
 void init()
          The distribution container calls this method on all handlers before starting the distribution process.
 MessageEnumeration process(DistributionMessage message)
          Processes a Message
 

Method Detail

getId

java.lang.String getId()
The handler Id. It's guaranteed that the handler id is the same that the node it is contained in.


init

void init()
          throws DistributionProcessingException,
                 DistributionConfigurationException
The distribution container calls this method on all handlers before starting the distribution process. This method will be called once for each handler. The order in which the handlers are created is not defined.

Throws:
DistributionProcessingException
DistributionConfigurationException

destroy

void destroy()
             throws DistributionProcessingException,
                    DistributionConfigurationException
The distribution container calls this method on all handlers before finishing the distribution process, allowing them to clean up resources. This method is called once for each handler. The order in which the handlers are destroyed is not defined.

Throws:
DistributionProcessingException
DistributionConfigurationException

process

MessageEnumeration process(DistributionMessage message)
                           throws DistributionProcessingException,
                                  DistributionConfigurationException
Processes a Message

Returns:
The result of the handle processing, usually indicating whether the processing of this message has succeeded or failed.
Throws:
DistributionProcessingException
DistributionConfigurationException


Copyright © 2006 null. All Rights Reserved.