org.jboss.soa.esb.listeners.ha
Class FirstAvailable

java.lang.Object
  extended by org.jboss.soa.esb.listeners.ha.FirstAvailable
All Implemented Interfaces:
LoadBalancePolicy

public class FirstAvailable
extends java.lang.Object
implements LoadBalancePolicy

LoadBalancingPolicy implementation that always favor the first available target i.e. no load balancing occurs. Nevertheless, the first target is randomly selected. This does not mean that fail-over will not occur if the first epr in the list dies. In this case, fail-over will occur, and a new epr will become the first member and invocation will continously be invoked on the same new epr until its death. Code based on jbossas ha framework.

Author:
Kurt Stam.
See Also:
LoadBalancePolicy

Field Summary
protected  EPR electedEPR
           
 
Constructor Summary
FirstAvailable()
           
 
Method Summary
 EPR chooseEPR(ServiceClusterInfo serviceCluster)
          Called when the ServiceInvoker wishes to know on which node the next invocation must be performed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

electedEPR

protected transient EPR electedEPR
Constructor Detail

FirstAvailable

public FirstAvailable()
Method Detail

chooseEPR

public EPR chooseEPR(ServiceClusterInfo serviceCluster)
Description copied from interface: LoadBalancePolicy
Called when the ServiceInvoker wishes to know on which node the next invocation must be performed.

Specified by:
chooseEPR in interface LoadBalancePolicy
Parameters:
serviceCluster - A list of potential eprs
Returns:
The selected epr for the next invocation