|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.cid.distribution.DistributionNode
public class DistributionNode
This class represents each one of the nodes defined in a distribution process. A node may hold a reference to a message handler and to a list of forwards.
Each node holds the forwarding information that conforms the process flow logic. The @see org.cid.distribution.core.MessageFlowController class uses this data to route the messages between the different nodes.
A node wraps the calls to the lifecycle methods of a MessageHandler, performing some control operations and getting metrics.
Constructor Summary | |
---|---|
DistributionNode()
Default constructor |
Method Summary | |
---|---|
void |
addForward(Forward forward)
Adds a forward |
static void |
addRules(org.apache.commons.digester.Digester d,
java.lang.String patternPrefix)
Configures additional rules for the commons-digester library. |
void |
destroy()
Cleans up this node |
java.util.List<Forward> |
getForwards()
Returns the forwards list. |
MessageHandler |
getHandler()
|
java.lang.String |
getId()
The handler Id. |
long |
getInitMilliseconds()
|
int |
getMessagesProcessed()
Returns the total count of messages processed by this node. |
long |
getProcessMilliseconds()
Returns the count of milliseconds spent by this node in its processing. |
void |
init()
Initializes this node |
MessageEnumeration |
process(DistributionMessage message)
Performs the node operation with a message. |
void |
setDistributionContext(DistributionContext context)
A callback method that DistributionContextAware objects must implement. |
void |
setHandler(MessageHandler handler)
|
void |
setId(java.lang.String id)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DistributionNode()
Method Detail |
---|
public MessageHandler getHandler()
public void setHandler(MessageHandler handler)
handler
- The handler to set.public void addForward(Forward forward)
public java.util.List<Forward> getForwards()
public static void addRules(org.apache.commons.digester.Digester d, java.lang.String patternPrefix)
public void setDistributionContext(DistributionContext context)
DistributionContextAware
setDistributionContext
in interface DistributionContextAware
public MessageEnumeration process(DistributionMessage message) throws DistributionProcessingException, DistributionConfigurationException
Performs the node operation with a message.
This method calls the homologue process method on the handler contained in this node.
process
in interface MessageHandler
DistributionProcessingException
DistributionConfigurationException
public int getMessagesProcessed()
public long getProcessMilliseconds()
public void init() throws DistributionProcessingException, DistributionConfigurationException
init
in interface MessageHandler
DistributionProcessingException
DistributionConfigurationException
public void destroy() throws DistributionProcessingException, DistributionConfigurationException
destroy
in interface MessageHandler
DistributionProcessingException
DistributionConfigurationException
public long getInitMilliseconds()
public java.lang.String getId()
MessageHandler
getId
in interface MessageHandler
public void setId(java.lang.String id)
id
- The id to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |