org.springframework.integration.dispatcher
Class DispatcherTask
java.lang.Object
org.springframework.integration.dispatcher.DispatcherTask
- All Implemented Interfaces:
- java.lang.Runnable, MessagingTask
public class DispatcherTask
- extends java.lang.Object
- implements MessagingTask
A task for polling MessageDispatchers
. If
#broadcast
is set to false
(the default), each message
will be sent to a single MessageHandler
. Otherwise, each
retrieved Message
will be sent to all of the handlers.
- Author:
- Mark Fisher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DispatcherTask
public DispatcherTask(MessageChannel channel)
setSchedule
public void setSchedule(Schedule schedule)
getSchedule
public Schedule getSchedule()
- Specified by:
getSchedule
in interface MessagingTask
addHandler
public void addHandler(MessageHandler handler)
dispatch
public int dispatch()
- Retrieves messages and dispatches to the executors.
- Returns:
- the number of messages processed
dispatchMessage
protected boolean dispatchMessage(Message<?> message)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable