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

FamilyClusterInfoImpl

public class FamilyClusterInfoImpl extends Object implements org.jboss.ha.framework.interfaces.FamilyClusterInfo
Default implementation of FamilyClusterInfo
see
org.jboss.ha.framework.interfaces.FamilyClusterInfo
see
org.jboss.ha.framework.interfaces.ClusteringTargetsRepository
author
Sacha Labourey.
version
$Revision: 57188 $

Fields Summary
public String
familyName
ArrayList
targets
long
currentViewId
boolean
isViewMembersInSyncWithViewId
int
cursor
Object
arbitraryObject
Constructors Summary
private FamilyClusterInfoImpl()

      
   // Static --------------------------------------------------------
    
   // Constructors --------------------------------------------------
   
      
protected FamilyClusterInfoImpl(String familyName, ArrayList targets, long viewId)

      this.familyName = familyName;
      this.targets = (ArrayList) targets.clone();
      this.currentViewId = viewId;
      
      this.isViewMembersInSyncWithViewId = false;
   
Methods Summary
public booleancurrentMembershipInSyncWithViewId()

      return this.isViewMembersInSyncWithViewId;
   
public booleanequals(java.lang.Object o)

      if (o instanceof FamilyClusterInfoImpl)
      {
         FamilyClusterInfoImpl fr = (FamilyClusterInfoImpl)o;
         return fr.familyName == this.familyName;
      }
      else
         return false;         
   
public longgetCurrentViewId()

 return this.currentViewId; 
public intgetCursor()

 return this.cursor; 
public java.lang.StringgetFamilyName()

 return this.familyName; 
public java.lang.ObjectgetObject()

 return this.arbitraryObject; 
public synchronized java.util.ArrayListgetTargets()
Returns an immutable subclass of ArrayList.

 
      return new ImmutableArrayList(this.targets); 
   
public inthashCode()

      return this.familyName.hashCode ();
   
public java.util.ArrayListremoveDeadTarget(java.lang.Object target)

      synchronized (this)
      {
         ArrayList tmp = (ArrayList) targets.clone();
         tmp.remove (target);
         this.targets = tmp;
         this.isViewMembersInSyncWithViewId = false;
         return new ImmutableArrayList(this.targets);
      }      
   
public voidresetView()

      synchronized (this)
      {
         this.currentViewId = -1;
         this.isViewMembersInSyncWithViewId = false;
      }
   
public intsetCursor(int cursor)

 return (this.cursor = cursor);
public java.lang.ObjectsetObject(java.lang.Object whatever)

 this.arbitraryObject = whatever; return this.arbitraryObject; 
public java.lang.StringtoString()

      StringBuffer tmp = new StringBuffer(super.toString());
      tmp.append("{familyName=");
      tmp.append(familyName);
      tmp.append(",targets=");
      tmp.append(targets);
      tmp.append(",currentViewId=");
      tmp.append(currentViewId);
      tmp.append(",isViewMembersInSyncWithViewId=");
      tmp.append(isViewMembersInSyncWithViewId);
      tmp.append(",cursor=");
      tmp.append(cursor);
      tmp.append(",arbitraryObject=");
      tmp.append(arbitraryObject);
      tmp.append("}");
      return tmp.toString();
   
public java.util.ArrayListupdateClusterInfo(java.util.ArrayList targets, long viewId)

      synchronized (this)
      {
         this.targets = (ArrayList) targets.clone();
         this.currentViewId = viewId;
         this.isViewMembersInSyncWithViewId = true;
         return new ImmutableArrayList(this.targets);
      }