org.springframework.integration.dispatcher
Class AbstractDispatcher
java.lang.Object
org.springframework.integration.dispatcher.AbstractDispatcher
- All Implemented Interfaces:
- MessageDispatcher, MessageTarget
- 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, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
targets
protected final java.util.List<MessageTarget> targets
timeout
private volatile long timeout
taskExecutor
private volatile org.springframework.core.task.TaskExecutor taskExecutor
AbstractDispatcher
public AbstractDispatcher()
setTimeout
public void setTimeout(long timeout)
- Description copied from interface:
MessageDispatcher
- Specify the timeout for sending to a target (in milliseconds).
Note that this value will only be applicable for blocking targets.
The default value is 0.
- Specified by:
setTimeout
in interface MessageDispatcher
addTarget
public boolean addTarget(MessageTarget target)
- Specified by:
addTarget
in interface MessageDispatcher
removeTarget
public boolean removeTarget(MessageTarget target)
- Specified by:
removeTarget
in interface MessageDispatcher
setTaskExecutor
public void setTaskExecutor(org.springframework.core.task.TaskExecutor taskExecutor)
- Specify a
TaskExecutor
for invoking the target endpoints.
If none is provided, the invocation will occur in the thread
that runs this polling dispatcher.
getTaskExecutor
protected org.springframework.core.task.TaskExecutor getTaskExecutor()
sendMessageToTarget
protected final boolean sendMessageToTarget(Message<?> message,
MessageTarget target)