[jboss-cvs] JBossAS SVN: r69436 - in trunk/cluster/src: main/org/jboss/ha/singleton and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 29 00:14:46 EST 2008


Author: bstansberry at jboss.com
Date: 2008-01-29 00:14:46 -0500 (Tue, 29 Jan 2008)
New Revision: 69436

Modified:
   trunk/cluster/src/etc/deploy-hasingleton-beans.xml
   trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java
Log:
[JBAS-4261] Port HASingleton "restart on merge" to trunk

Modified: trunk/cluster/src/etc/deploy-hasingleton-beans.xml
===================================================================
--- trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2008-01-29 04:55:32 UTC (rev 69435)
+++ trunk/cluster/src/etc/deploy-hasingleton-beans.xml	2008-01-29 05:14:46 UTC (rev 69436)
@@ -39,9 +39,21 @@
       <property name="targetStartMethod">deploySingletons</property>
       <property name="targetStartMethodArgument">${jboss.server.home.url}deploy-hasingleton</property>
       <property name="targetStopMethod">undeploySingletons</property>
-      <property name="targetStopMethodArgument">${jboss.server.home.url}deploy-hasingleton</property>
+      <property name="targetStopMethodArgument">${jboss.server.home.url}deploy-hasingleton</property>
+      
       <!-- whether to register thread context classloader for the RPC handler, default is false -->
-      <!--<property name="registerThreadContextClassLoader">false</property>-->   
+      <!--<property name="registerThreadContextClassLoader">false</property>--> 
+      
+      <!-- Whether the singleton should be restarted (i.e. invoke the TargetStopMethod and then the
+           TargetStartMethod) if a cluster merge occurs while this node is the singleton master.
+           A cluster merge means there may have been more than one singleton master during the period
+           when communication between some or all of the nodes in the cluster was disrupted; hence the
+           surviving master may not be aware of state changes made by another master. Restarting the
+           singleton gives it a signal that it should refresh its internal state from any external
+           store.
+           By default this is set to true.
+      -->
+      <property name="restartOnMerge">true</property>  
       
    </bean>
 

Modified: trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java	2008-01-29 04:55:32 UTC (rev 69435)
+++ trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java	2008-01-29 05:14:46 UTC (rev 69436)
@@ -1,8 +1,8 @@
 /*
  * 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.
+ * Copyright 2008, 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
@@ -29,7 +29,46 @@
  */
 public interface HASingletonSupportMBean extends HASingletonMBean 
 {
-   /** The HASingleton election policy MBean */
-   void setElectionPolicy(HASingletonElectionPolicy mb);
+   /** 
+    * Sets the policy used to determine which cluster node will
+    * become the master when the service topology changes.
+    * 
+    * @param policy the policy. Can be <code>null</code>. 
+    */
+   void setElectionPolicy(HASingletonElectionPolicy policy);
+   
+   /** 
+    * Gets the policy used to determine which cluster node will
+    * become the master when the service topology changes.
+    * 
+    * @return the policy. Can be <code>null</code>. 
+    */
    HASingletonElectionPolicy getElectionPolicy();
+
+   /**
+    * Gets whether this singleton will stop and restart itself if it is the
+    * master and a cluster merge occurs.
+    * <p/>
+    * A restart allows the service to reset any state that may
+    * have gotten out-of-sync with the rest of the cluster while
+    * the just-merged split was in effect.
+    * 
+    * @return <code>true</code> if a restart will occur, <code>false</code>
+    *         otherwise
+    */
+   boolean getRestartOnMerge();
+
+   /**
+    * Sets whether this singleton will stop and restart itself if it is the
+    * master and a cluster merge occurs.
+    * <p/>
+    * A restart allows the service to reset any state that may
+    * have gotten out-of-sync with the rest of the cluster while
+    * the just-merged split was in effect.
+    * 
+    * @param restartOnMerge <code>true</code> if a restart should occur, 
+    *                       <code>false</code> otherwise. Default is
+    *                       <code>true</code>.
+    */
+   void setRestartOnMerge(boolean restartOnMerge);
 }




More information about the jboss-cvs-commits mailing list