org.springframework.integration.dispatcher
Class AbstractDispatcher
java.lang.Object
org.springframework.integration.dispatcher.AbstractDispatcher
- All Implemented Interfaces:
- MessageDispatcher
- Direct Known Subclasses:
- BroadcastingDispatcher, UnicastingDispatcher
public abstract class AbstractDispatcher
- extends java.lang.Object
- implements MessageDispatcher
Base class for MessageDispatcher
implementations.
The subclasses implement the actual dispatching strategy, but this base class
manages the registration of MessageHandler
s. 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.
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
AbstractDispatcher
public AbstractDispatcher()
getHandlers
protected java.util.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 java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getHandlerCount
public int getHandlerCount()
- Returns:
- The current number of handlers