[jboss-cvs] JBossAS SVN: r61153 - branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Mar 6 15:00:06 EST 2007
Author: bstansberry at jboss.com
Date: 2007-03-06 15:00:06 -0500 (Tue, 06 Mar 2007)
New Revision: 61153
Added:
branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java
Modified:
branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicyMBean.java
branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupport.java
branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java
Log:
[JBAS-4179] Update interfaces for HASingletonEvictionPolicy
Copied: branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java (from rev 61110, trunk/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java)
===================================================================
--- branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java (rev 0)
+++ branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicy.java 2007-03-06 20:00:06 UTC (rev 61153)
@@ -0,0 +1,56 @@
+package org.jboss.ha.singleton;
+
+import org.jboss.ha.framework.interfaces.ClusterNode;
+import org.jboss.ha.framework.interfaces.HAPartition;
+
+public interface HASingletonElectionPolicy
+{
+
+ /**
+ * Called by the HASingleton to provide the election policy a reference to
+ * itself. A policy that was designed to elect a particular kind of singleton
+ * could downcast this object to a particular type and then access the
+ * singleton for state information needed for the election decision.
+ */
+ void setManagedSingleton(Object singleton);
+
+ Object getManagedSingleton();
+
+ /**
+ * Sets the HAPartition; from this the election policy can gain
+ * access to the DistributedReplicantManager for tracking the
+ * deployment topology for the singleton service and to the HAPartition
+ * for making group RPC calls.
+ */
+ void setHAPartition(HAPartition partition);
+
+ HAPartition getHAPartition();
+
+ /**
+ * Return the elected master node.
+ * @return the master node
+ */
+ ClusterNode pickSingleton();
+
+ /**
+ * Given the HAPartition, return the elected master node.
+ * @param partition
+ * @return the master node
+ */
+ ClusterNode pickSingleton(HAPartition partition);
+
+ /**
+ * Conducts an election and returns whether the managed service
+ * is the master, based on the current view of partition.
+ * @return true only if the managed service is the master
+ */
+ boolean isElectedMaster();
+
+ /**
+ * Given the HAPartition, return whether the managed service is the master.
+ * @param partition
+ * @return true only if the managed service is the master
+ */
+ boolean isElectedMaster(HAPartition partition);
+
+}
\ No newline at end of file
Modified: branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicyMBean.java
===================================================================
--- branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicyMBean.java 2007-03-06 19:59:08 UTC (rev 61152)
+++ branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonElectionPolicyMBean.java 2007-03-06 20:00:06 UTC (rev 61153)
@@ -22,61 +22,15 @@
package org.jboss.ha.singleton;
-import org.jboss.ha.framework.interfaces.ClusterNode;
-import org.jboss.ha.framework.interfaces.HAPartition;
/**
* Management Bean for HASinigleton Election Policy.
-
+ *
* @author <a href="mailto:Alex.Fu at novell.com">Alex Fu</a>.
* @version $Revision: 46010 $
*
*/
public interface HASingletonElectionPolicyMBean
- extends org.jboss.system.ServiceMBean
+ extends org.jboss.system.ServiceMBean, HASingletonElectionPolicy
{
- /**
- * Called by the HASingleton to provide the election policy a reference to
- * itself. A policy that was designed to elect a particular kind of singleton
- * could downcast this object to a particular type and then access the
- * singleton for state information needed for the election decision.
- */
- void setManagedSingleton(Object singleton);
- Object getManagedSingleton();
-
- /**
- * Sets the HAPartition; from this the election policy can gain
- * access to the DistributedReplicantManager for tracking the
- * deployment topology for the singleton service and to the HAPartition
- * for making group RPC calls.
- */
- void setHAPartition(HAPartition partition);
- HAPartition getHAPartition();
-
- /**
- * Return the elected master node.
- * @return the master node
- */
- ClusterNode pickSingleton();
-
- /**
- * Given the HAPartition, return the elected master node.
- * @param partition
- * @return the master node
- */
- ClusterNode pickSingleton(HAPartition partition);
-
- /**
- * Conducts an election and returns whether the managed service
- * is the master, based on the current view of partition.
- * @return true only if the managed service is the master
- */
- public boolean isElectedMaster();
-
- /**
- * Given the HAPartition, return whether the managed service is the master.
- * @param partition
- * @return true only if the managed service is the master
- */
- public boolean isElectedMaster(HAPartition partiton);
}
Modified: branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupport.java
===================================================================
--- branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupport.java 2007-03-06 19:59:08 UTC (rev 61152)
+++ branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupport.java 2007-03-06 20:00:06 UTC (rev 61153)
@@ -41,7 +41,7 @@
// Private Data --------------------------------------------------
private boolean isMasterNode = false;
- private HASingletonElectionPolicyMBean mElectionPolicyMB = null;
+ private HASingletonElectionPolicy mElectionPolicyMB = null;
// Constructors --------------------------------------------------
@@ -66,17 +66,17 @@
}
/**
- * @see HASingletonSupportMBean#setHASingletonElectionPolicyMBean(HASingletonElectionPolicyMBean)
+ * @see HASingletonSupportMBean#setElectionPolicy(HASingletonElectionPolicy)
*/
- public void setHASingletonElectionPolicyMBean(HASingletonElectionPolicyMBean mb)
+ public void setElectionPolicy(HASingletonElectionPolicy mb)
{
this.mElectionPolicyMB = mb;
}
/**
- * @see HASingletonSupportMBean#getHASingletonElectionPolicyMBean()
+ * @see HASingletonSupportMBean#getElectionPolicy()
*/
- public HASingletonElectionPolicyMBean getHASingletonElectionPolicyMBean()
+ public HASingletonElectionPolicy getElectionPolicy()
{
return this.mElectionPolicyMB;
}
Modified: branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java
===================================================================
--- branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java 2007-03-06 19:59:08 UTC (rev 61152)
+++ branches/Branch_4_2/cluster/src/main/org/jboss/ha/singleton/HASingletonSupportMBean.java 2007-03-06 20:00:06 UTC (rev 61153)
@@ -30,6 +30,6 @@
public interface HASingletonSupportMBean extends HASingletonMBean
{
/** The HASingleton election policy MBean */
- void setHASingletonElectionPolicyMBean(HASingletonElectionPolicyMBean mb);
- HASingletonElectionPolicyMBean getHASingletonElectionPolicyMBean();
+ void setElectionPolicy(HASingletonElectionPolicy mb);
+ HASingletonElectionPolicy getElectionPolicy();
}
More information about the jboss-cvs-commits
mailing list