[jboss-cvs] JBossAS SVN: r94888 - in branches/Branch_5_x/cluster/src: main/org/jboss/ha/framework/server and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 14 15:46:38 EDT 2009
Author: bstansberry at jboss.com
Date: 2009-10-14 15:46:38 -0400 (Wed, 14 Oct 2009)
New Revision: 94888
Modified:
branches/Branch_5_x/cluster/src/etc/hapartition-jboss-beans.xml
branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java
Log:
[JBAS-7157] Indicate a merge in view change logging
[JBAS-7209] Deprecate nodeAddress property
Modified: branches/Branch_5_x/cluster/src/etc/hapartition-jboss-beans.xml
===================================================================
--- branches/Branch_5_x/cluster/src/etc/hapartition-jboss-beans.xml 2009-10-14 19:05:20 UTC (rev 94887)
+++ branches/Branch_5_x/cluster/src/etc/hapartition-jboss-beans.xml 2009-10-14 19:46:38 UTC (rev 94888)
@@ -33,9 +33,6 @@
<!-- Name of the partition being built -->
<property name="partitionName">${jboss.partition.name:DefaultPartition}</property>
- <!-- The address used to determine the node name -->
- <property name="nodeAddress">${jboss.bind.address}</property>
-
<!-- Max time (in ms) to wait for state transfer to complete. Increase for large states -->
<property name="stateTransferTimeout">30000</property>
Modified: branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
===================================================================
--- branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-10-14 19:05:20 UTC (rev 94887)
+++ branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java 2009-10-14 19:46:38 UTC (rev 94888)
@@ -850,10 +850,10 @@
this.currentViewId = newView.getVid().getId();
// Keep a list of other members only for "exclude-self" RPC calls
- this.jgotherMembers = (Vector<Address>)newView.getMembers().clone();
+ this.jgotherMembers = cloneMembers(newView);
this.jgotherMembers.remove (this.channel.getLocalAddress());
this.otherMembers = this.translateAddresses (this.jgotherMembers); // TRANSLATE!
- Vector<ClusterNode> translatedNewView = this.translateAddresses ((Vector<Address>)newView.getMembers().clone());
+ Vector<ClusterNode> translatedNewView = this.translateAddresses (cloneMembers(newView));
this.logHistory ("New view: " + translatedNewView + " with viewId: " + this.currentViewId +
" (old view: " + this.members + " )");
@@ -861,7 +861,7 @@
// Save the previous view and make a copy of the new view
Vector<ClusterNode> oldMembers = this.members;
- Vector<Address> newjgMembers = (Vector<Address>)newView.getMembers().clone();
+ Vector<Address> newjgMembers = cloneMembers(newView);
Vector<ClusterNode> newMembers = this.translateAddresses(newjgMembers); // TRANSLATE
this.members = newMembers;
this.jgmembers = newjgMembers;
@@ -887,15 +887,16 @@
int difference = newMembers.size() - oldMembers.size();
+ boolean merge = newView instanceof MergeView;
if (this.isCurrentNodeCoordinator ())
{
this.clusterLifeCycleLog.info ("New cluster view for partition " + this.getPartitionName() + " (id: " +
- this.currentViewId + ", delta: " + difference + ") : " + this.members);
+ this.currentViewId + ", delta: " + difference+ ", merge: " + merge + ") : " + this.members);
}
else
{
this.log.info("New cluster view for partition " + this.getPartitionName() + ": " +
- this.currentViewId + " (" + this.members + " delta: " + difference + ")");
+ this.currentViewId + " (" + this.members + " delta: " + difference+ ", merge: " + merge + ")");
}
// Build a ViewChangeEvent for the asynch listeners
@@ -1532,7 +1533,8 @@
{
newMembers=new Vector<ClusterNode>();
}
- Vector<ClusterNode> dead=(Vector<ClusterNode>)oldMembers.clone();
+
+ Vector<ClusterNode> dead= cloneMembers(oldMembers);
dead.removeAll(newMembers);
this.log.debug("dead members: " + dead);
return dead;
@@ -1554,7 +1556,7 @@
{
allMembers=new Vector<ClusterNode>();
}
- Vector<ClusterNode> newMembers=(Vector<ClusterNode>)allMembers.clone();
+ Vector<ClusterNode> newMembers= cloneMembers(allMembers);
newMembers.removeAll(oldMembers);
return newMembers;
}
@@ -1564,18 +1566,17 @@
Vector<View> originatingGroups)
{
this.log.debug("Begin notifyListeners, viewID: "+viewID);
+ List<HAMembershipListener> toNotify = null;
synchronized(theListeners)
{
// JBAS-3619 -- don't hold synch lock while notifying
- theListeners = (ArrayList<HAMembershipListener>) theListeners.clone();
+ toNotify = cloneListeners(theListeners);
}
- for (int i = 0; i < theListeners.size(); i++)
+ for (HAMembershipListener aListener : toNotify)
{
- HAMembershipListener aListener = null;
try
{
- aListener = theListeners.get(i);
if(originatingGroups != null && (aListener instanceof HAMembershipExtendedListener))
{
HAMembershipExtendedListener exListener = (HAMembershipExtendedListener) aListener;
@@ -1783,13 +1784,19 @@
return this.stackName;
}
+ @Deprecated
public InetAddress getNodeAddress()
{
return this.nodeAddress;
}
+ /**
+ * @deprecated Will be removed in JBoss AS 6
+ */
+ @Deprecated
public void setNodeAddress(InetAddress address)
{
+ log.warn(ClusterPartition.class.getSimpleName() + "setNodeAddress() is deprecated");
this.nodeAddress = address;
}
@@ -2347,6 +2354,9 @@
private static class Sync extends AbstractQueuedSynchronizer
{
+ /** The serialVersionUID */
+ private static final long serialVersionUID = 1L;
+
Sync(int state)
{
this.setState(state);
@@ -2378,11 +2388,6 @@
this.sync.releaseShared(CLOSED);
}
- public void await() throws InterruptedException
- {
- this.sync.acquireSharedInterruptibly(0);
- }
-
public boolean await(long timeout) throws InterruptedException
{
return this.sync.tryAcquireSharedNanos(0, TimeUnit.MILLISECONDS.toNanos(timeout));
@@ -2403,48 +2408,21 @@
}
}
-// private synchronized void registerDRM()
-// {
-// MBeanServer mbs = getServer();
-// if (this.replicantManager != null && mbs != null)
-// {
-// try
-// {
-// ObjectName oname = getDRMObjectName();
-// mbs.registerMBean(this.replicantManager, oname);
-// }
-// catch (JMException e)
-// {
-// log.error("Unable to register DRM in JMX", e);
-// }
-// }
-// }
+ @SuppressWarnings("unchecked")
+ private static Vector<Address> cloneMembers(View view)
+ {
+ return (Vector<Address>) view.getMembers().clone();
+ }
-// private void unregisterDRM()
-// {
-// MBeanServer mbs = getServer();
-// if (this.replicantManager != null && mbs != null)
-// {
-// try
-// {
-// ObjectName oname = getDRMObjectName();
-// if (mbs.isRegistered(oname))
-// {
-// mbs.unregisterMBean(oname);
-// }
-// }
-// catch (JMException e)
-// {
-// log.error("Unable to register DRM in JMX", e);
-// }
-// }
-//
-// }
-
-// private ObjectName getDRMObjectName() throws MalformedObjectNameException
-// {
-// ObjectName oname = new ObjectName(DistributedReplicantManagerImpl.OBJECT_NAME_BASE + ",partitionName=" + getPartitionName());
-// return oname;
-// }
+ @SuppressWarnings("unchecked")
+ private static Vector<ClusterNode> cloneMembers(Vector<ClusterNode> toClone)
+ {
+ return (Vector<ClusterNode>) toClone.clone();
+ }
+ @SuppressWarnings("unchecked")
+ private static List<HAMembershipListener> cloneListeners(ArrayList<HAMembershipListener> toClone)
+ {
+ return (List<HAMembershipListener>) toClone.clone();
+ }
}
Modified: branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java
===================================================================
--- branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java 2009-10-14 19:05:20 UTC (rev 94887)
+++ branches/Branch_5_x/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionMBean.java 2009-10-14 19:46:38 UTC (rev 94888)
@@ -63,8 +63,11 @@
String getNodeName();
/**
- * The node address used to generate the node name
+ * Currently unused legacy property.
+ *
+ * @deprecated Will be removed in AS 6
*/
+ @Deprecated
InetAddress getNodeAddress();
/** The version of JGroups this is running on */
More information about the jboss-cvs-commits
mailing list