Spring Integration

org.springframework.integration.dispatcher
Class AbstractDispatcher

java.lang.Object
  extended by org.springframework.integration.dispatcher.AbstractDispatcher
All Implemented Interfaces:
MessageDispatcher
Direct Known Subclasses:
BroadcastingDispatcher, UnicastingDispatcher

public abstract class AbstractDispatcher
extends Object
implements MessageDispatcher

Base class for MessageDispatcher implementations.

The subclasses implement the actual dispatching strategy, but this base class manages the registration of MessageHandlers. Although the implemented dispatching strategies may invoke handles in different ways (e.g. round-robin vs. failover), this class does maintain the order of the underlying collection. See the OrderedAwareLinkedHashSet for more detail.

Author:
Mark Fisher, Iwein Fuld, Oleg Zhurakousky

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
AbstractDispatcher()
           
 
Method Summary
 boolean addHandler(MessageHandler handler)
          Add the handler to the internal Set.
protected  List<MessageHandler> getHandlers()
          Returns a copied, unmodifiable List of this dispatcher's handlers.
 boolean removeHandler(MessageHandler handler)
          Remove the handler from the internal handler Set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.dispatcher.MessageDispatcher
dispatch
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AbstractDispatcher

public AbstractDispatcher()
Method Detail

getHandlers

protected List<MessageHandler> getHandlers()
Returns a copied, unmodifiable List of this dispatcher's handlers. This is provided for access by subclasses.


addHandler

public boolean addHandler(MessageHandler handler)
Add the handler to the internal Set.

Specified by:
addHandler in interface MessageDispatcher
Returns:
the result of Set.add(Object)

removeHandler

public boolean removeHandler(MessageHandler handler)
Remove the handler from the internal handler Set.

Specified by:
removeHandler in interface MessageDispatcher
Returns:
the result of Set.remove(Object)

toString

public String toString()
Overrides:
toString in class Object

Spring Integration

Copyright © 2010. All Rights Reserved.