Spring Integration

org.springframework.integration.dispatcher
Class RoundRobinLoadBalancingStrategy

java.lang.Object
  extended by org.springframework.integration.dispatcher.RoundRobinLoadBalancingStrategy
All Implemented Interfaces:
LoadBalancingStrategy

public class RoundRobinLoadBalancingStrategy
extends Object
implements LoadBalancingStrategy

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

Since:
1.0.3
Author:
Iwein Fuld, Mark Fisher

Constructor Summary
RoundRobinLoadBalancingStrategy()
           
 
Method Summary
 Iterator<MessageHandler> getHandlerIterator(Message<?> message, 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobinLoadBalancingStrategy

public RoundRobinLoadBalancingStrategy()
Method Detail

getHandlerIterator

public final Iterator<MessageHandler> getHandlerIterator(Message<?> message,
                                                         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 interface LoadBalancingStrategy

Spring Integration

Copyright © 2010. All Rights Reserved.