org.jboss.ha.framework.interfaces
Interface LoadBalancePolicy

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
FirstAvailable (src) , FirstAvailableIdenticalAllProxies (src) , RandomRobin (src) , RoundRobin (src)

public interface LoadBalancePolicy
extends java.io.Serializable

Base interface for load-balancing policies. It is possible to implement many different load-balancing policies by implementing this simple interface and using it in the different clustered services (home interface of SLSB for example)


Field Summary
static long serialVersionUID
          The serialVersionUID
 
Method Summary
 java.lang.Object chooseTarget(FamilyClusterInfo (src)  clusterFamily)
          Called when the stub wishes to know on which node the next invocation must be performed.
 java.lang.Object chooseTarget(FamilyClusterInfo (src)  clusterFamily, Invocation (src)  routingDecision)
          Called when the stub wishes to know on which node the next invocation must be performed.
 void init(HARMIClient (src)  father)
          Initialize the policy with a reference to its parent stub.
 

Field Detail

serialVersionUID

public static final long serialVersionUID
The serialVersionUID

Since:
1.3.4.2
See Also:
Constant Field Values (src)
Method Detail

init

public void init(HARMIClient (src)  father)
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 java.lang.Object chooseTarget(FamilyClusterInfo (src)  clusterFamily)
Called when the stub wishes to know on which node the next invocation must be performed.

Parameters:
clusterFamily - A list of potential target nodes
Returns:
The selected target for the next invocation

chooseTarget

public java.lang.Object chooseTarget(FamilyClusterInfo (src)  clusterFamily,
                                     Invocation (src)  routingDecision)
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