[jboss-cvs] JBoss Messaging SVN: r3875 - in branches/Branch_Stable/src/main/org/jboss/messaging/core: impl/postoffice and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 14 04:56:36 EDT 2008


Author: jmesnil
Date: 2008-03-14 04:56:36 -0400 (Fri, 14 Mar 2008)
New Revision: 3875

Modified:
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
   branches/Branch_Stable/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-1244 - GroupMember passes null to Channel.connect()
- in GroupMember.start(), when connecting to JGroups Channels, added -CTRL & -DATA prefixes to the channels's groupName
- the basis for theses ID is set in MessagingPostOfficeService: ChannelPartitionName if it is set (i.e. AS 5 Config + multiplexer) or GroupName otherwise

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java	2008-03-13 23:46:12 UTC (rev 3874)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/jchannelfactory/MultiplexerChannelFactory.java	2008-03-14 08:56:36 UTC (rev 3875)
@@ -26,6 +26,7 @@
 import javax.management.ObjectName;
 
 import org.jboss.messaging.core.contract.ChannelFactory;
+import org.jboss.messaging.core.impl.postoffice.GroupMember;
 import org.jgroups.Channel;
 
 /**
@@ -123,7 +124,7 @@
    public Channel createControlChannel() throws Exception
    {
       return (Channel) server.invoke(this.channelFactory, MUX_OPERATION,
-         new Object[]{controlStack, uniqueID + "-CTRL", Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
+         new Object[]{controlStack, uniqueID + GroupMember.CONTROL_SUFFIX, Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
    }
 
    //Note that for the data channel we don't receive state immediately after connecting so third param
@@ -131,7 +132,7 @@
    public Channel createDataChannel() throws Exception
    {
       return (Channel) server.invoke(this.channelFactory, MUX_OPERATION,
-         new Object[]{dataStack, uniqueID + "-DATA", Boolean.FALSE, uniqueID}, MUX_SIGNATURE);
+         new Object[]{dataStack, uniqueID + GroupMember.DATA_SUFFIX, Boolean.FALSE, uniqueID}, MUX_SIGNATURE);
    }
 
    // Package protected ----------------------------------------------------------------------------

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2008-03-13 23:46:12 UTC (rev 3874)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/impl/postoffice/GroupMember.java	2008-03-14 08:56:36 UTC (rev 3875)
@@ -61,6 +61,10 @@
  */
 public class GroupMember
 {
+   public static final String DATA_SUFFIX = "-DATA";
+
+   public static final String CONTROL_SUFFIX = "-CTRL";
+
    private static final Logger log = Logger.getLogger(GroupMember.class);
    
 	private boolean trace = log.isTraceEnabled();
@@ -139,7 +143,7 @@
       
       starting = true;
          
-      controlChannel.connect(groupName);
+      controlChannel.connect(groupName + CONTROL_SUFFIX);
          
       //The first thing that happens after connect is a view change arrives
       //Then the state will arrive (if we are not the first member)
@@ -174,7 +178,7 @@
       
       //Now connect the data channel.
    	
-      dataChannel.connect(groupName);
+      dataChannel.connect(groupName + DATA_SUFFIX);
    }
    
    public void stop() throws Exception

Modified: branches/Branch_Stable/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2008-03-13 23:46:12 UTC (rev 3874)
+++ branches/Branch_Stable/src/main/org/jboss/messaging/core/jmx/MessagingPostOfficeService.java	2008-03-14 08:56:36 UTC (rev 3875)
@@ -402,13 +402,18 @@
                jChannelFactory = new XMLChannelFactory(controlChannelConfig, dataChannelConfig);
             }
          	
+         	// http://jira.jboss.org/jira/browse/JBMESSAGING-1244
+         	// if the channelPartitionName is set, we use it to identify the control and
+         	// data channels. Otherwise, we fall back to use groupName
+         	String channelName = (channelPartitionName == null)? channelPartitionName : groupName;
+         	
 	         postOffice =  new MessagingPostOffice(ds, tm, sqlProperties,
 	                                               createTablesOnStartup,
 	                                               nodeId, officeName, ms,
 	                                               pm,
 	                                               tr, ff, cf, idManager,
 	                                               clusterNotifier,
-	                                               groupName,
+	                                               channelName,
 	                                               jChannelFactory,
 	                                               stateTimeout, castTimeout,
                                                   serverPeer.isSupportsFailover(),




More information about the jboss-cvs-commits mailing list