LoadBalancePolicy implementation that, once a target is chosen, always favors that same target; i.e. no further load balancing occurs. Useful in cases where "sticky session" behavior is desired. Differs from the {@link org.jboss.ha.client.loadbalance.FirstAvailable superclass} in the waythat the {@link #chooseTarget(FamilyClusterInfo,Invocation)} method initially selects the target. Instead of always randomly selecting the target, the method will check the passed invocation's metadata for the {@link ClusterConstants#HA_TARGET} key in the {@link ClusterConstants#CLUSTERED_REMOTING} group. If an object is found there and it is a valid target associated with the given FamilyClusterInfo, that target will be used. Otherwise the target will be randomly chosen. This mechanism allows the proxy that contains this policy to specify the preferred target via invocation metadata.
Each proxy using this policy will choose its own preferred target: the target is not shared accross the proxy family. For shared behaviour please take a look at {@link FirstAvailableIdenticalAllProxies}.
@author Brian Stansberry
@version $Revision: 57642 $