[jboss-cvs] JBoss Messaging SVN: r8212 - in branches/port1842/src/main/org/jboss: messaging/core/impl/postoffice and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Feb 6 04:18:13 EST 2011
Author: gaohoward
Date: 2011-02-06 04:18:13 -0500 (Sun, 06 Feb 2011)
New Revision: 8212
Modified:
branches/port1842/src/main/org/jboss/jms/server/MessagingClusterHealthMBean.java
branches/port1842/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
Log:
save
Modified: branches/port1842/src/main/org/jboss/jms/server/MessagingClusterHealthMBean.java
===================================================================
--- branches/port1842/src/main/org/jboss/jms/server/MessagingClusterHealthMBean.java 2011-02-06 09:15:24 UTC (rev 8211)
+++ branches/port1842/src/main/org/jboss/jms/server/MessagingClusterHealthMBean.java 2011-02-06 09:18:13 UTC (rev 8212)
@@ -221,10 +221,14 @@
ObjectName spName = new ObjectName(serverPeer);
startService(spName);
- //starat post office
+ //start post office
ObjectName poName = new ObjectName(postOffice);
startService(poName);
+ //wait for jgroups back
+ MessagingPostOffice pm = (MessagingPostOffice)JMXAccessor.getJMXAttributeOverSecurity(server, poName, "Instance");
+ pm.waitForJGroups();
+
List<ObjectName> copy = new ArrayList<ObjectName>(connectionFactories);
connectionFactories.clear();
//start cf
Modified: branches/port1842/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java
===================================================================
--- branches/port1842/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2011-02-06 09:15:24 UTC (rev 8211)
+++ branches/port1842/src/main/org/jboss/messaging/core/impl/postoffice/MessagingPostOffice.java 2011-02-06 09:18:13 UTC (rev 8212)
@@ -260,6 +260,8 @@
private boolean keepOldFailoverModel = true;
+ private Object jgroupsLock = new Object();
+
// Constructors ---------------------------------------------------------------------------------
public boolean isFailoverOnNodeLeave()
@@ -2760,6 +2762,12 @@
failoverNodeID = fid;
firstNode = false;
}
+
+ synchronized (jgroupsLock)
+ {
+ jgroupsLock.notify();
+ }
+
}
else
{
@@ -4172,6 +4180,11 @@
return nState.isDead();
}
+
+ public int nodeNum()
+ {
+ return states.size();
+ }
}
private class NodeState
@@ -4253,5 +4266,23 @@
{
groupMember.unregisterChannelInJmx(server, channelPartitionName);
}
+
+ public void waitForJGroups()
+ {
+ synchronized (jgroupsLock)
+ {
+ //if I am alone but there are still others there
+ while (isFirstNode() && (clusterState.nodeNum() > 1))
+ {
+ try
+ {
+ jgroupsLock.wait(5000);
+ }
+ catch (InterruptedException e)
+ {
+ }
+ }
+ }
+ }
}
More information about the jboss-cvs-commits
mailing list