org.springframework.integration.dispatcher
Class DispatcherTask

java.lang.Object
  extended by 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

Constructor Summary
DispatcherTask(MessageChannel channel)
           
 
Method Summary
 void addHandler(MessageHandler handler)
           
 int dispatch()
          Retrieves messages and dispatches to the executors.
protected  boolean dispatchMessage(Message<?> message)
           
 Schedule getSchedule()
           
 void run()
           
 void setSchedule(Schedule schedule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DispatcherTask

public DispatcherTask(MessageChannel channel)
Method Detail

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