FileDocCategorySizeDatePackage
FirstAvailableIdenticalAllProxies.javaAPI DocJBoss 4.2.13302Fri Jul 13 20:52:36 BST 2007org.jboss.ha.framework.interfaces

FirstAvailableIdenticalAllProxies

public class FirstAvailableIdenticalAllProxies extends 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 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 *not* elect its own prefered target: the target *is* shared with all proxies that belong to the same family (for a different behaviour please take a look at FirstAvailable)
see
org.jboss.ha.framework.interfaces.LoadBalancePolicy
author
Sacha Labourey.
version
$Revision: 57188 $

Fields Summary
private static final long
serialVersionUID
Constructors Summary
Methods Summary
public java.lang.ObjectchooseTarget(FamilyClusterInfo clusterFamily)

      return chooseTarget(clusterFamily, null);
   
public java.lang.ObjectchooseTarget(FamilyClusterInfo clusterFamily, org.jboss.invocation.Invocation routingDecision)

      Object target = clusterFamily.getObject ();
      ArrayList targets = clusterFamily.getTargets ();

      if (targets.size () == 0)
         return null;
      
      if (target != null && targets.contains (target) )
      {
         return target;
      }
      else
      {
         int cursor = RandomRobin.localRandomizer.nextInt (targets.size());
         target = targets.get(cursor);
         clusterFamily.setObject (target);
         return target;
      }   
   
public voidinit(HARMIClient father)


   // Attributes ----------------------------------------------------
   
   // Static --------------------------------------------------------
   
   // Constructors --------------------------------------------------
       
    // Public --------------------------------------------------------
   
       
   
      // do not use the HARMIClient in this policy