org.cid.distribution.base
Class MessageHandlerBase

java.lang.Object
  extended by org.cid.distribution.base.MessageHandlerBase
All Implemented Interfaces:
DistributionContextAware, MessageHandler
Direct Known Subclasses:
DataCombinatorHandler, ListCombinatorHandler, MailEditorHandler, MailWriterHandler, MessageCreatorHandler, PassthroughHandler, POP3Handler, ScriptingHandler, SMTPHandler

public abstract class MessageHandlerBase
extends java.lang.Object
implements MessageHandler, DistributionContextAware

A helper base class for the MessageHandler plugins contained in a DistributionProcess.

Version:
$Revision:127 $

Constructor Summary
MessageHandlerBase()
          Initializes the instance.
 
Method Summary
static void addRules(org.apache.commons.digester.Digester d, java.lang.String patternPrefix)
          Configures additional rules for the commons-digester library.
 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.
 void setDistributionContext(DistributionContext context)
          Sets the DistributionContext reference of this object.
 void setId(java.lang.String id)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.cid.distribution.MessageHandler
process
 

Constructor Detail

MessageHandlerBase

public MessageHandlerBase()
Initializes the instance.

Method Detail

setDistributionContext

public void setDistributionContext(DistributionContext context)
Sets the DistributionContext reference of this object.

Specified by:
setDistributionContext in interface DistributionContextAware

addRules

public static void addRules(org.apache.commons.digester.Digester d,
                            java.lang.String patternPrefix)
Configures additional rules for the commons-digester library.


init

public void init()
          throws DistributionProcessingException,
                 DistributionConfigurationException
Description copied from interface: MessageHandler
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.

Specified by:
init in interface MessageHandler
Throws:
DistributionProcessingException
DistributionConfigurationException

destroy

public void destroy()
             throws DistributionProcessingException,
                    DistributionConfigurationException
Description copied from interface: MessageHandler
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.

Specified by:
destroy in interface MessageHandler
Throws:
DistributionProcessingException
DistributionConfigurationException

getId

public java.lang.String getId()
Description copied from interface: MessageHandler
The handler Id. It's guaranteed that the handler id is the same that the node it is contained in.

Specified by:
getId in interface MessageHandler
Returns:
Returns the id.

setId

public void setId(java.lang.String id)
Parameters:
id - The id to set.


Copyright © 2006 null. All Rights Reserved.