org.springframework.integration.dispatcher
Class AbstractDispatcher
java.lang.Object
org.springframework.integration.dispatcher.AbstractDispatcher
- All Implemented Interfaces:
- MessageDispatcher
- Direct Known Subclasses:
- BroadcastingDispatcher, SimpleDispatcher
public abstract class AbstractDispatcher
- extends java.lang.Object
- implements MessageDispatcher
Base class for MessageDispatcher
implementations.
- Author:
- Mark Fisher
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
handlers
protected final java.util.Set<MessageHandler> handlers
AbstractDispatcher
public AbstractDispatcher()
addHandler
public boolean addHandler(MessageHandler handler)
- Specified by:
addHandler
in interface MessageDispatcher
removeHandler
public boolean removeHandler(MessageHandler handler)
- Specified by:
removeHandler
in interface MessageDispatcher
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
- Specify a
TaskExecutor
for invoking the handlers.
If none is provided, the invocation will occur in the thread
that runs this polling dispatcher.
getTaskExecutor
protected org.springframework.core.task.TaskExecutor getTaskExecutor()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
sendMessageToHandler
protected boolean sendMessageToHandler(Message<?> message,
MessageHandler handler)
- Convenience method available for subclasses. Returns 'true' unless a
"Selective Consumer" throws a
MessageRejectedException
.