org.talend.esb.servicelocator.cxf.internal
Class EvenDistributionSelectionStrategy

java.lang.Object
  extended by org.talend.esb.servicelocator.cxf.internal.LocatorSelectionStrategy
      extended by org.talend.esb.servicelocator.cxf.internal.EvenDistributionSelectionStrategy
All Implemented Interfaces:
org.apache.cxf.clustering.FailoverStrategy

public class EvenDistributionSelectionStrategy
extends LocatorSelectionStrategy

Performs a client side round robin strategy. In case of a fail over all strategies are equivalent. A random alternative endpoint is selected. If multiple clients use EvenDistributionSelectionStrategy it could happen that all clients choose subsequently the same endpoints since the locator instances for each client operate independently. RandomSelectionStrategy avoids this problem.


Field Summary
 
Fields inherited from class org.talend.esb.servicelocator.cxf.internal.LocatorSelectionStrategy
LOG, random
 
Constructor Summary
EvenDistributionSelectionStrategy()
           
 
Method Summary
 List<String> getAlternateAddresses(org.apache.cxf.message.Exchange exchange)
           
 String getPrimaryAddress(org.apache.cxf.message.Exchange exchange)
           
protected  List<String> getRotatedList(List<String> strings)
           
 void setReloadAdressesCount(int reloadAdressesCount)
           
 
Methods inherited from class org.talend.esb.servicelocator.cxf.internal.LocatorSelectionStrategy
getAlternateEndpoints, getEndpoints, getServiceLocator, getServiceName, selectAlternateAddress, selectAlternateEndpoint, setMatcher, setServiceLocator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EvenDistributionSelectionStrategy

public EvenDistributionSelectionStrategy()
Method Detail

getRotatedList

protected List<String> getRotatedList(List<String> strings)

setReloadAdressesCount

public void setReloadAdressesCount(int reloadAdressesCount)

getAlternateAddresses

public List<String> getAlternateAddresses(org.apache.cxf.message.Exchange exchange)

getPrimaryAddress

public String getPrimaryAddress(org.apache.cxf.message.Exchange exchange)
Specified by:
getPrimaryAddress in class LocatorSelectionStrategy
Returns:


Copyright © 2011–2013 Talend Inc.. All rights reserved.