org.springframework.integration.dispatcher
Class RoundRobinDispatcher

java.lang.Object
  extended by org.springframework.integration.dispatcher.AbstractDispatcher
      extended by org.springframework.integration.dispatcher.AbstractUnicastDispatcher
          extended by org.springframework.integration.dispatcher.RoundRobinDispatcher
All Implemented Interfaces:
MessageDispatcher

public class RoundRobinDispatcher
extends AbstractUnicastDispatcher

Round-robin implementation of AbstractUnicastDispatcher. This implementation will keep track of the index of the handler that has been tried first and use a different starting handler every dispatch.

Author:
Iwein Fuld

Field Summary
 
Fields inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
logger
 
Constructor Summary
RoundRobinDispatcher()
           
 
Method Summary
protected  java.util.Iterator<MessageHandler> getHandlerIterator(java.util.List<MessageHandler> handlers)
          Returns an iterator that starts at a new point in the list every time the first part of the list that is skipped will be used at the end of the iteration, so it guarantees all handlers are returned once on subsequent next() invocations.
 
Methods inherited from class org.springframework.integration.dispatcher.AbstractUnicastDispatcher
dispatch
 
Methods inherited from class org.springframework.integration.dispatcher.AbstractDispatcher
addHandler, getHandlers, getTaskExecutor, removeHandler, sendMessageToHandler, setTaskExecutor, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoundRobinDispatcher

public RoundRobinDispatcher()
Method Detail

getHandlerIterator

protected java.util.Iterator<MessageHandler> getHandlerIterator(java.util.List<MessageHandler> handlers)
Returns an iterator that starts at a new point in the list every time the first part of the list that is skipped will be used at the end of the iteration, so it guarantees all handlers are returned once on subsequent next() invocations.

Specified by:
getHandlerIterator in class AbstractUnicastDispatcher
Parameters:
handlers - all handlers for this dispatcher