[jboss-cvs] JBossAS SVN: r57638 - 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:24:58 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-10-12 23:24:57 -0400 (Thu, 12 Oct 2006)
New Revision: 57638

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

Modified: projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/ClusteringTargetsRepository.java
===================================================================
--- projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/ClusteringTargetsRepository.java	2006-10-13 03:24:09 UTC (rev 57637)
+++ projects/cluster/trunk/ha-client/src/main/java/org/jboss/ha/client/ClusteringTargetsRepository.java	2006-10-13 03:24:57 UTC (rev 57638)
@@ -1,40 +1,43 @@
 /*
-  * 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.Hashtable;
 import java.util.List;
 
+
 /**
  * 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*
+ * 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 the same EJB form *2*
  * proxy families.
  *
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfo
- * @see org.jboss.ha.framework.interfaces.FamilyClusterInfoImpl
+ * @see org.jboss.ha.client.FamilyClusterInfo
+ * @see org.jboss.ha.client.FamilyClusterInfoImpl
  *
  * @author  <a href="mailto:sacha.labourey at cogito-info.ch">Sacha Labourey</a>.
+ * @author brian.stansberry at jboss.com
+ * 
  * @version $Revision$
  *
  * <p><b>Revisions:</b>
@@ -44,7 +47,6 @@
  * <li> First implementation </li>
  * </ul>
  */
-
 public class ClusteringTargetsRepository
 {
    // Constants -----------------------------------------------------
@@ -55,11 +57,30 @@
    
    // Static --------------------------------------------------------
    
+   /**
+    * Same as {@link #initTarget(String, List, long) initTarget(familyName, targets, 0L);
+    */
    public synchronized static FamilyClusterInfo initTarget (String familyName, List targets)
    {
       return initTarget (familyName, targets, 0L);
    }
    
+   /**
+    * Checks for the existence of a {@link FamilyClusterInfo} with the given name.  If
+    * found, {@link FamilyClusterInfo#updateClusterInfo(List, long) updates} it; otherwise
+    * creates and caches a new FamilyClusterInfo.
+    * <p>
+    * This method must be somehow synchronized to avoid race conditions leading to
+    * multiple FamilyClusterInfo instances for the same <code>familyName</code>.
+    * </p>
+    * 
+    * @param familyName  the name of the proxy family
+    * @param targets     the current list of targets for the proxy family
+    * @param viewId      long that can be used as a shorthand identifier
+    *                    for the list of targets
+    *                    
+    * @return a {@link FamilyClusterInfo} encapsulating the current state of the <code>familyName</code>.
+    */
    public synchronized static FamilyClusterInfo initTarget (String familyName, List targets, long viewId)
    {
       // this method must be somehow synchronized to avoid multiple FamilyClusterInfoImpl 
@@ -82,6 +103,13 @@
          
    }
    
+   /**
+    * Gets the {@link FamilyClusterInfo} registered under <code>familyName</code>.
+    * 
+    * @param familyName the identifier of the FamilyClusterInfo
+    * 
+    * @return the FamilyClusterInfo, or <code>null</code> if none is registered
+    */
    public static FamilyClusterInfo getFamilyClusterInfo (String familyName)
    {
       return (FamilyClusterInfo)families.get (familyName);
@@ -89,6 +117,7 @@
    
    // Constructors --------------------------------------------------
    
+   /** Prevent external instantiation */
    private ClusteringTargetsRepository () {}
    
    // Public --------------------------------------------------------




More information about the jboss-cvs-commits mailing list