|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ha.framework.interfaces.FirstAvailable
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 member in the list dies. In this case, fail-over will occur, and a new target will become the first member and invocation will continously be invoked on the same new target until its death. Each proxy using this policy will elect its own prefered target: the target is not shared accross the proxy family (for this behaviour please take a look at FirstAvailableIdenticalAllProxies)
Revisions:
2002/08/24: Sacha Labourey
- Use the target repository
- First choice is randomly selected to distribute the initial load
- When the list of targets change, we try to keep using the same
previously elected target node if it still exists. Previously,
we were working with the position id of the target node, thus
if the list order changed, we were switching to another node
while our prefered node was still up
,
Serialized FormField Summary | |
protected Object |
electedTarget
|
Constructor Summary | |
FirstAvailable()
|
Method Summary | |
Object |
chooseTarget(FamilyClusterInfo clusterFamily)
Called when the stub wishes to know on which node the next invocation must be performed. |
Object |
chooseTarget(FamilyClusterInfo clusterFamily,
org.jboss.invocation.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 |
Field Detail |
protected transient Object electedTarget
Constructor Detail |
public FirstAvailable()
Method Detail |
public void init(HARMIClient father)
LoadBalancePolicy
init
in interface LoadBalancePolicy
father
- The stub that owns the policypublic Object chooseTarget(FamilyClusterInfo clusterFamily)
LoadBalancePolicy
chooseTarget
in interface LoadBalancePolicy
clusterFamily
- A list of potential target nodes
public Object chooseTarget(FamilyClusterInfo clusterFamily, org.jboss.invocation.Invocation routingDecision)
LoadBalancePolicy
chooseTarget
in interface LoadBalancePolicy
clusterFamily
- A list of potential target nodesroutingDecision
- The actual invocation object if the policy wants
to have some kind of invocation-based routing strategy
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |