org.jboss.ha.framework.interfaces
Class RoundRobin

java.lang.Object
  extended by org.jboss.ha.framework.interfaces.RoundRobin
All Implemented Interfaces:
Serializable, org.jboss.ha.client.loadbalance.LoadBalancePolicy

public class RoundRobin
extends Object
implements LoadBalancePolicy

LoadBalancingPolicy implementation that always favor the next available target load balancing always occurs.

Version:
$Revision: 81001 $
Author:
Sacha Labourey., Bill Burke.
See Also:
LoadBalancePolicy, Serialized Form

Constructor Summary
RoundRobin()
           
 
Method Summary
 Object chooseTarget(org.jboss.ha.framework.interfaces.FamilyClusterInfo clusterFamily)
           
 Object chooseTarget(org.jboss.ha.framework.interfaces.FamilyClusterInfo clusterFamily, Invocation routingDecision)
          Called when the stub wishes to know on which node the next invocation must be performed.
 void init(HARMIClient father)
          Initialize the policy with a reference to its parent stub.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRobin

public RoundRobin()
Method Detail

init

public void init(HARMIClient father)
Description copied from interface: LoadBalancePolicy
Initialize the policy with a reference to its parent stub. the load-balancing policy implementation can use HARMIClient data to take its decision

Parameters:
father - The stub that owns the policy

chooseTarget

public Object chooseTarget(org.jboss.ha.framework.interfaces.FamilyClusterInfo clusterFamily)
Specified by:
chooseTarget in interface org.jboss.ha.client.loadbalance.LoadBalancePolicy

chooseTarget

public Object chooseTarget(org.jboss.ha.framework.interfaces.FamilyClusterInfo clusterFamily,
                           Invocation routingDecision)
Description copied from interface: LoadBalancePolicy
Called when the stub wishes to know on which node the next invocation must be performed.

Parameters:
clusterFamily - A list of potential target nodes
routingDecision - The actual invocation object if the policy wants to have some kind of invocation-based routing strategy
Returns:
The selected target for the next invocation


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.