[jboss-cvs] JBossAS SVN: r57640 - projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 12 23:26:15 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-10-12 23:26:14 -0400 (Thu, 12 Oct 2006)
New Revision: 57640

Modified:
   projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/FamilyClusterInfoImpl.java
Log:
Fix license and package; add javadoc

Modified: projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/FamilyClusterInfoImpl.java
===================================================================
--- projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/FamilyClusterInfoImpl.java	2006-10-13 03:25:21 UTC (rev 57639)
+++ projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/FamilyClusterInfoImpl.java	2006-10-13 03:26:14 UTC (rev 57640)
@@ -1,55 +1,71 @@
 /*
-  * JBoss, Home of Professional Open Source
-  * Copyright 2005, JBoss Inc., and individual contributors as indicated
-  * by the @authors tag. See the copyright.txt in the distribution for a
-  * full listing of individual contributors.
-  *
-  * This is free software; you can redistribute it and/or modify it
-  * under the terms of the GNU Lesser General Public License as
-  * published by the Free Software Foundation; either version 2.1 of
-  * the License, or (at your option) any later version.
-  *
-  * This software is distributed in the hope that it will be useful,
-  * but WITHOUT ANY WARRANTY; without even the implied warranty of
-  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  * Lesser General Public License for more details.
-  *
-  * You should have received a copy of the GNU Lesser General Public
-  * License along with this software; if not, write to the Free
-  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-  */
-package org.jboss.ha.framework.interfaces;
+ * JBoss, a division of Red Hat
+ * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ha.client;
 
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+
 /**
- * Default implementation of FamilyClusterInfo
- *
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfo
- * @see org.jboss.ha.framework.interfaces.ClusteringTargetsRepository
- *
- * @author  <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
- * @version $Revision$
+ * Default implementation of  {@link FamilyClusterInfo} .
+ * @see org.jboss.ha.client.ClusteringTargetsRepository
+ * @author   <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
+ * @author  brian.stansberry at jboss.com
+ * @version  $Revision$
  */
 public class FamilyClusterInfoImpl implements FamilyClusterInfo
-{
-   
+{   
    // Constants -----------------------------------------------------
    
    // Attributes ----------------------------------------------------
    
-   public String familyName = null;
-   ArrayList targets = null;
-   long currentViewId = 0;
-   boolean isViewMembersInSyncWithViewId = false;
+   private String familyName = null;
+   private ArrayList targets = null;
+   private long currentViewId = 0;
+   private boolean isViewMembersInSyncWithViewId = false;
    
-   int cursor = FamilyClusterInfo.UNINITIALIZED_CURSOR;
-   Object arbitraryObject = null;
+   private int cursor = FamilyClusterInfo.UNINITIALIZED_CURSOR;
+   private Object arbitraryObject = null;
       
    // Static --------------------------------------------------------
+
+   private static ArrayList cloneList(List toClone)
+   {
+      if (toClone instanceof ArrayList)
+      {
+         synchronized (toClone)
+         {
+            return (ArrayList) ((ArrayList) toClone).clone();
+         }
+      }
+      
+      ArrayList clone = new ArrayList(toClone.size());
+      synchronized (toClone)
+      {
+        clone.addAll(toClone);
+      }
+      return clone;      
+   }
     
    // Constructors --------------------------------------------------
    
@@ -61,6 +77,7 @@
       this.targets = cloneList(targets);
       this.currentViewId = viewId;
       
+      //TODO shouldn't this be true??
       this.isViewMembersInSyncWithViewId = false;
    }
 
@@ -68,23 +85,45 @@
    
    // FamilyClusterInfo implementation ----------------------------------------------
    
+   /**
+    * Get the familyName.
+    * @return  the familyName.
+    * @uml.property  name="familyName"
+    */
    public String getFamilyName () { return this.familyName; }
    
    /**
-    * Returns an unmodifiable view of the target list.
-    * 
-    * @see Collections#unmodifiableList(List)
+    * @see  Collections#unmodifiableList(List)
+    * @uml.property  name="targets"
     */
    public synchronized List getTargets () 
    { 
       return Collections.unmodifiableList(this.targets); 
    }
+   /**
+    * Get the currentViewId.
+    * @return  the currentViewId.
+    * @uml.property  name="currentViewId"
+    */
    public long getCurrentViewId () { return this.currentViewId; }
+   /**
+    * Get the cursor.
+    * @return  the cursor.
+    * @uml.property  name="cursor"
+    */
    public int getCursor () { return this.cursor; }
+   /**
+    * Set the cursor.
+    * @param cursor  The cursor to set.
+    * @uml.property  name="cursor"
+    */
    public int setCursor (int cursor) { return (this.cursor = cursor);}
    public Object getObject () { return this.arbitraryObject; }
    public Object setObject (Object whatever) { this.arbitraryObject = whatever; return this.arbitraryObject; }
    
+   /** 
+    * @see Collections#unmodifiableList(List)
+    */
    public List removeDeadTarget(Object target)
    {
       synchronized (this)
@@ -97,6 +136,9 @@
       }      
    }
    
+   /** 
+    * @see Collections#unmodifiableList(List)
+    */
    public List updateClusterInfo (List targets, long viewId)
    {
       synchronized (this)
@@ -158,6 +200,7 @@
       tmp.append("}");
       return tmp.toString();
    }
+   
    // Package protected ---------------------------------------------
    
    // Protected -----------------------------------------------------
@@ -165,22 +208,5 @@
    // Private -------------------------------------------------------
    
    // Inner classes -------------------------------------------------
-
-   private static ArrayList cloneList(List toClone)
-   {
-      if (toClone instanceof ArrayList)
-      {
-      	 synchronized (toClone)
-      	 {
-         	return (ArrayList) ((ArrayList) toClone).clone();
-         }
-      }
-      
-      ArrayList clone = new ArrayList(toClone.size());
-      synchronized (toClone)
-      {
-      	clone.addAll(toClone);
-      }
-      return clone;      
-   }
+   
 }




More information about the jboss-cvs-commits mailing list