[jboss-cvs] JBossAS SVN: r69246 - trunk/cluster/src/main/org/jboss/ha/framework/server.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 23 15:59:00 EST 2008


Author: bstansberry at jboss.com
Date: 2008-01-23 15:59:00 -0500 (Wed, 23 Jan 2008)
New Revision: 69246

Modified:
   trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
   trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionConfig.java
Log:
[JBAS-5167] Support injection of JGroups Channel into ClusterPartition

Modified: trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java	2008-01-23 19:13:27 UTC (rev 69245)
+++ trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartition.java	2008-01-23 20:59:00 UTC (rev 69246)
@@ -274,7 +274,12 @@
       log.debug("Creating Multiplexer Channel for partition " + getPartitionName() +
             " using stack " + getMultiplexerStack());
 
-      channel = createMuxChannel(config);
+      channel = config.getChannel();
+      if (channel == null)
+      {
+         channel = createMuxChannel(config);
+         config.setChannel(channel);
+      }
       
       channel.setOpt(Channel.AUTO_RECONNECT, Boolean.TRUE);
       channel.setOpt(Channel.AUTO_GETSTATE, Boolean.TRUE);

Modified: trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionConfig.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionConfig.java	2008-01-23 19:13:27 UTC (rev 69245)
+++ trunk/cluster/src/main/org/jboss/ha/framework/server/ClusterPartitionConfig.java	2008-01-23 20:59:00 UTC (rev 69246)
@@ -26,6 +26,7 @@
 import org.jboss.cache.Cache;
 import org.jboss.cache.config.Configuration;
 import org.jboss.system.server.ServerConfigUtil;
+import org.jgroups.Channel;
 import org.jgroups.ChannelFactory;
 
 /**
@@ -42,6 +43,7 @@
    // Attributes ----------------------------------------------------
 
    private   Cache cache;
+   private   Channel channel;
    private   ChannelFactory multiplexer;
    private   String stackName;
    private   String partitionName = ServerConfigUtil.getDefaultPartitionName();
@@ -136,7 +138,17 @@
    {
       this.allow_sync_events = allowSync;
    }
+   
+   public Channel getChannel()
+   {
+      return channel;
+   }
 
+   public void setChannel(Channel channel)
+   {
+      this.channel = channel;
+   }
+
    public ChannelFactory getMultiplexer()
    {
       return multiplexer;
@@ -166,11 +178,7 @@
    {
       this.cache = cache;
       Configuration config = cache.getConfiguration();
-      multiplexer = config.getRuntimeConfig().getMuxChannelFactory();
-      
-      if (multiplexer == null)
-         throw new IllegalArgumentException("Cache not configured for a multiplexer");
-      
+      this.multiplexer = config.getRuntimeConfig().getMuxChannelFactory();
       this.stackName = config.getMultiplexerStack();
    }
 




More information about the jboss-cvs-commits mailing list