[jboss-cvs] JBossAS SVN: r57646 - projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 12 23:35:56 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-10-12 23:35:55 -0400 (Thu, 12 Oct 2006)
New Revision: 57646

Modified:
   projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/AsynchEventHandler.java
   projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/HATarget.java
   projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/ReplicantsManagerInterceptor.java
Log:
Fix license and package

Modified: projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/AsynchEventHandler.java
===================================================================
--- projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/AsynchEventHandler.java	2006-10-13 03:35:06 UTC (rev 57645)
+++ projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/AsynchEventHandler.java	2006-10-13 03:35:55 UTC (rev 57646)
@@ -1,39 +1,34 @@
 /*
-* 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.server;
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.server.impl;
 
+import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
 import org.jboss.logging.Logger;
 
-import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
-
 /**
- * Utility class that accepts objects into a queue and maintains a separate
- * thread that reads them off the queue and passes them to a registered
- * "processor".
- * 
- * @todo find a better home for this than the cluster module
- * 
- * @author <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
- * @version $Revision$
+ * Utility class that accepts objects into a queue and maintains a separate thread that reads them off the queue and passes them to a registered "processor".
+ * @todo  find a better home for this than the cluster module
+ * @author  <a href="mailto://brian.stansberry@jboss.com">Brian Stansberry</a>
+ * @version  $Revision$
  */
 class AsynchEventHandler implements Runnable
 {
@@ -156,6 +151,11 @@
          handlerThread.interrupt(); // kill it
    }
    
+   /**
+    * Get the stopped.
+    * @return  the stopped.
+    * @uml.property  name="stopped"
+    */
    public boolean isStopped()
    {
       return stopped;

Modified: projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/HATarget.java
===================================================================
--- projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/HATarget.java	2006-10-13 03:35:06 UTC (rev 57645)
+++ projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/HATarget.java	2006-10-13 03:35:55 UTC (rev 57646)
@@ -1,75 +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.server;
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.server.impl;
 
+import EDU.oswego.cs.dl.util.concurrent.Latch;
+import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.List;
-import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
-import org.jboss.ha.framework.interfaces.DistributedReplicantManager.ReplicantListener;
-import org.jboss.ha.framework.interfaces.HAPartition;
-import java.io.Serializable;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
+import org.jboss.ha.server.spi.DistributedReplicantManager;
+import org.jboss.ha.server.spi.DistributedReplicantManager.ReplicantListener;
 
-/** 
- * This class is a holder and manager of replicants.
- * It manages lists of replicated objects and changes the list as the HAPartition
- * notifies it.
- *
- * @author bill at burkecentral.com
- * @version $Revision$
- *
- * <p><b>Revisions:</b><br>
- * <p><b>2002/01/13: Bill Burke</b>
- * <ol>
- *   <li>Initial revision
- * </ol>
+/**
+ * This class is a holder and manager of replicants. It manages lists of replicated objects and changes the list as the HAPartition notifies it.
+ * @author  bill at burkecentral.com
+ * @version  $Revision$  <p><b>Revisions:</b><br>  <p><b>2002/01/13: Bill Burke</b>  <ol>  <li>Initial revision  </ol>
  */
 public class HATarget
-   implements ReplicantListener
+   implements DistributedReplicantManager.ReplicantListener
 {
    public static final int DISABLE_INVOCATIONS = 0;
    public static final int MAKE_INVOCATIONS_WAIT = 1;
    public static final int ENABLE_INVOCATIONS = 2;
    
    protected String replicantName;
-   protected ArrayList replicants = new ArrayList();
-   protected HAPartition partition = null;
+   /** 
+    * @uml.property name="replicants"
+    */
+   protected ArrayList replicants;
+   protected DistributedReplicantManager drm;
+   protected String partitionName;
    protected org.jboss.logging.Logger log;
    protected int clusterViewId = 0;
    protected Serializable target;
    protected int allowInvocationsStatus = 0;
    protected Latch latch = null;
    
-   public HATarget(HAPartition partition, 
+   public HATarget(DistributedReplicantManager drm, 
 		   String replicantName,
 		   Serializable target,
-         int allowInvocations) 
+           String partitionName,
+           int allowInvocations) 
       throws Exception
    {
       this.replicantName = replicantName;      
-      this.target = target;      
+      this.target = target;
+      this.partitionName = partitionName;
       init ();
       setInvocationsAuthorization (allowInvocations);
-      updateHAPartition(partition);
+      updateDRM(drm);
    }
    
    public void init() throws Exception
@@ -82,7 +78,7 @@
       StringBuffer buffer = new StringBuffer(super.toString());
       buffer.append('{');
       buffer.append("replicantName="+replicantName);
-      buffer.append("partition="+partition.getPartitionName());
+      buffer.append("partition="+partitionName);
       buffer.append("clusterViewId="+clusterViewId);
       buffer.append("allowInvocationsStatus="+allowInvocationsStatus);
       buffer.append("replicants="+replicants);
@@ -99,7 +95,7 @@
    {
       try
       {
-         this.cleanExistenceInCurrentHAPartition();
+         this.cleanExistenceInCurrentDRM();
          
          // maybe some threads are blocked: we let them go here:
          //
@@ -118,10 +114,10 @@
    {
       try
       {
-         if (this.partition != null)
+         if (this.drm != null)
          {
             log.debug ("Disabled called on HATarget");
-            this.partition.getDistributedReplicantManager().remove (this.replicantName);         
+            drm.remove (this.replicantName);         
          }      
       } 
       catch (Exception e)
@@ -130,17 +126,21 @@
       }
    }
    
+   /** 
+    * Get the replicants.
+    * @return  the replicants.
+    * @uml.property  name="replicants"
+    */
    public ArrayList getReplicants()
    {
       return replicants;
    }
    
-   public void updateHAPartition(HAPartition partition) throws Exception
+   public void updateDRM(DistributedReplicantManager drm) throws Exception
    {
-      cleanExistenceInCurrentHAPartition();
+      cleanExistenceInCurrentDRM();
       
-      this.partition = partition;
-      DistributedReplicantManager drm = partition.getDistributedReplicantManager();
+      this.drm = drm;
       drm.registerListener(this.replicantName, this);
       drm.add(this.replicantName, this.target);
    }
@@ -202,9 +202,14 @@
       latch = null;
    }
    
-   public HAPartition getAssociatedPartition ()
+   /**
+    * Get the partitionName.
+    * @return  the partitionName.
+    * @uml.property  name="partitionName"
+    */
+   public String getPartitionName()
    {
-       return this.partition;
+      return this.partitionName;
    }
    
    // DistributedReplicantManager.ReplicantListener implementation ------------
@@ -229,20 +234,29 @@
       
    }
    
-   protected void cleanExistenceInCurrentHAPartition()
+   protected void cleanExistenceInCurrentDRM()
    {
-      if (this.partition != null)
+      if (this.drm != null)
       {
          try
          {
-            DistributedReplicantManager drm = partition.getDistributedReplicantManager();
             drm.unregisterListener(this.replicantName, this);
             drm.remove(this.replicantName);         
          } 
          catch (Exception e)
          {
-            log.error("failed to clean existence in current ha partition", e);
+            log.error("failed to clean existence in current DRM", e);
          }
       }    
    }
+
+   /**
+    * Setter of the property <tt>replicants</tt>
+    * @param replicants  The replicants to set.
+    * @uml.property  name="replicants"
+    */
+   public void setReplicants(ArrayList replicants)
+   {
+      this.replicants = replicants;
+   }
 }

Modified: projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/ReplicantsManagerInterceptor.java
===================================================================
--- projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/ReplicantsManagerInterceptor.java	2006-10-13 03:35:06 UTC (rev 57645)
+++ projects/cluster/trunk/ha-server/src/main/java/org/jboss/ha/server/impl/ReplicantsManagerInterceptor.java	2006-10-13 03:35:55 UTC (rev 57646)
@@ -1,38 +1,41 @@
 /*
-  * 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.aspects.remoting;
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.server.impl;
 
-import org.jboss.ha.framework.server.HATarget;
+import org.jboss.ha.client.ClusterConstants;
 
 import java.util.ArrayList;
 import java.util.Map;
 
 /**
- * Checks to see if this object is local in VM
+ * Checks to see if the hash of the cluster topology presented by the client
+ * matches the current topology; if not sends the current topology to the
+ * client as part of the response.
+ * 
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
  * @version $Revision$
  */
-public class ReplicantsManagerInterceptor implements org.jboss.aop.advice.Interceptor, ClusterConstants
+public class ReplicantsManagerInterceptor implements org.jboss.aop.advice.Interceptor
 {
    private final Map families;
 
@@ -49,7 +52,7 @@
    public Object invoke(org.jboss.aop.joinpoint.Invocation invocation) throws Throwable
    {
       Object response = invocation.invokeNext();
-      String clientFamily = (String) invocation.getMetaData(CLUSTERED_REMOTING, CLUSTER_FAMILY);
+      String clientFamily = (String) invocation.getMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_FAMILY);
 
       HATarget target = (HATarget) families.get(clientFamily);
       if (target == null)
@@ -57,7 +60,7 @@
          return response;
       }
 
-      Long clientViewId = (Long) invocation.getMetaData(CLUSTERED_REMOTING, CLUSTER_VIEW_ID);
+      Long clientViewId = (Long) invocation.getMetaData(ClusterConstants.CLUSTERED_REMOTING, ClusterConstants.CLUSTER_VIEW_ID);
       if (clientViewId == null)
       {
          // Maybe we're being invoked upon by a non-clustered proxy




More information about the jboss-cvs-commits mailing list