FileDocCategorySizeDatePackage
ClusteringTargetsRepository.javaAPI DocJBoss 4.2.13923Fri Jul 13 20:52:38 BST 2007org.jboss.ha.framework.interfaces

ClusteringTargetsRepository

public class ClusteringTargetsRepository extends Object
JVM singleton that associates a list of targets (+ other info) contained in a FamilyClusterInfo to a proxy family. For example All remote proxies for a given EJB in a given cluster are part of the same proxy family. Note that home and remote for a same EJB form *2* proxy families.
see
org.jboss.ha.framework.interfaces.FamilyClusterInfo
see
org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl
author
Sacha Labourey.
version
$Revision: 57188 $

Revisions:

2002/08/23, Sacha Labourey:

  • First implementation

Fields Summary
protected static Hashtable
families
Constructors Summary
private ClusteringTargetsRepository()

Methods Summary
public static FamilyClusterInfogetFamilyClusterInfo(java.lang.String familyName)

      return (FamilyClusterInfo)families.get (familyName);
   
public static synchronized FamilyClusterInfoinitTarget(java.lang.String familyName, java.util.ArrayList targets)

   
   // Static --------------------------------------------------------
   
           
   
      return initTarget (familyName, targets, 0L);
   
public static synchronized FamilyClusterInfoinitTarget(java.lang.String familyName, java.util.ArrayList targets, long viewId)

      // this method must be somehow synchronized to avoid multiple FamilyClusterInfoImpl 
      // for the same familyName in multi-threaded app accessing the same bean
      //
      FamilyClusterInfoImpl family = (FamilyClusterInfoImpl)families.get (familyName);
      if (family == null)
      {
         family = new FamilyClusterInfoImpl (familyName, targets, viewId);
         families.put (familyName, family);         
      }
      else
      {
         // no need to initialize: it is already done: we keep the same object
         //
         family.updateClusterInfo (targets, viewId); // should not happen: possible if redeploy after undeploy fails
      }
         
      return family;