[jboss-cvs] JBoss Messaging SVN: r1922 - in trunk: src/main/org/jboss/messaging/core/plugin src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory tests/src/org/jboss/test/messaging/tools tests/src/org/jboss/test/messaging/tools/jmx tests/src/org/jboss/test/messaging/tools/jmx/rmi

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 8 17:36:27 EST 2007


Author: clebert.suconic at jboss.com
Date: 2007-01-08 17:36:20 -0500 (Mon, 08 Jan 2007)
New Revision: 1922

Added:
   trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexerJChannelFactory.java
Removed:
   trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java
Modified:
   trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
   trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-723

Modified: trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java	2007-01-08 20:44:43 UTC (rev 1921)
+++ trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -44,7 +44,7 @@
 import org.jboss.messaging.core.plugin.postoffice.cluster.MessagePullPolicy;
 import org.jboss.messaging.core.plugin.postoffice.cluster.Peer;
 import org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory.JChannelFactory;
-import org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory.MultiplexorJChannelFactory;
+import org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory.MultiplexerJChannelFactory;
 import org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory.XMLJChannelFactory;
 import org.jboss.messaging.core.tx.TransactionRepository;
 import org.w3c.dom.Element;
@@ -347,9 +347,9 @@
             }
             if (info!=null)
             {
-               log.debug(this + " uses multiplexor");
+               log.debug(this + " uses MultiplexerJChannelFactory");
                jChannelFactory =
-                  new MultiplexorJChannelFactory(server, channelFactoryName, channelPartitionName,
+                  new MultiplexerJChannelFactory(server, channelFactoryName, channelPartitionName,
                                                  syncChannelName, asyncChannelName);
             }
             else

Copied: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexerJChannelFactory.java (from rev 1918, trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java	2007-01-08 20:31:14 UTC (rev 1918)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexerJChannelFactory.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -0,0 +1,138 @@
+/*
+   * JBoss, Home of Professional Open Source
+   * Copyright 2005, JBoss Inc., and individual contributors as indicated
+   * by the @authors tag. See the copyright.txt in the distribution for a
+   * full listing of individual contributors.
+   *
+   * This is free software; you can redistribute it and/or modify it
+   * under the terms of the GNU Lesser General Public License as
+   * published by the Free Software Foundation; either version 2.1 of
+   * the License, or (at your option) any later version.
+   *
+   * This software is distributed in the hope that it will be useful,
+   * but WITHOUT ANY WARRANTY; without even the implied warranty of
+   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   * Lesser General Public License for more details.
+   *
+   * You should have received a copy of the GNU Lesser General Public
+   * License along with this software; if not, write to the Free
+   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+   */
+
+package org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import org.jgroups.JChannel;
+
+/**
+ * A JChannelFactory that will use the MBean JChannelFactory interface
+ *
+ * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
+ * @version <tt>$Revision$</tt>
+ * 
+ * $Id$
+ */
+public class MultiplexerJChannelFactory implements JChannelFactory
+{
+
+   // Constants
+   private static final String[] MUX_SIGNATURE = new String[]{"java.lang.String", "java.lang.String", "boolean", "java.lang.String"};
+
+   // Attributes
+   MBeanServer server;
+   ObjectName channelFactory;
+   String asyncStack;
+   String syncStack;
+   String uniqueID;
+   private static final String MUX_OPERATION = "createMultiplexerChannel";
+
+   // Static
+
+   // Constructors
+
+   public MultiplexerJChannelFactory(MBeanServer server,
+                                    ObjectName channelFactory,
+                                    String uniqueID,
+                                    String syncStack,
+                                    String asyncStack)
+   {
+      this.server = server;
+      this.channelFactory = channelFactory;
+      this.uniqueID = uniqueID;
+      this.asyncStack = asyncStack;
+      this.syncStack = syncStack;
+   }
+
+   // Public
+
+   public MBeanServer getServer()
+   {
+      return server;
+   }
+
+   public void setServer(MBeanServer server)
+   {
+      this.server = server;
+   }
+
+   public ObjectName getChannelFactory()
+   {
+      return channelFactory;
+   }
+
+   public void setChannelFactory(ObjectName channelFactory)
+   {
+      this.channelFactory = channelFactory;
+   }
+
+   public String getAsyncStack()
+   {
+      return asyncStack;
+   }
+
+   public void setAsyncStack(String asyncStack)
+   {
+      this.asyncStack = asyncStack;
+   }
+
+   public String getSyncStack()
+   {
+      return syncStack;
+   }
+
+   public void setSyncStack(String syncStack)
+   {
+      this.syncStack = syncStack;
+   }
+
+   public String getUniqueID()
+   {
+      return uniqueID;
+   }
+
+   public void setUniqueID(String uniqueID)
+   {
+      this.uniqueID = uniqueID;
+   }
+
+   public JChannel createSyncChannel() throws Exception
+   {
+      return (JChannel) server.invoke(this.channelFactory, MUX_OPERATION, new Object[]{syncStack, uniqueID, Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
+   }
+
+   public JChannel createASyncChannel() throws Exception
+   {
+      return (JChannel) server.invoke(this.channelFactory, MUX_OPERATION, new Object[]{asyncStack, uniqueID, Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
+   }
+
+   // Package protected
+
+   // Protected
+
+   // Private
+
+   // Inner classes
+
+}


Property changes on: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexerJChannelFactory.java
___________________________________________________________________
Name: svn:keywords
   + Id LastChangedDate Author Revision

Deleted: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java	2007-01-08 20:44:43 UTC (rev 1921)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/jchannelfactory/MultiplexorJChannelFactory.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -1,138 +0,0 @@
-/*
-   * JBoss, Home of Professional Open Source
-   * Copyright 2005, JBoss Inc., and individual contributors as indicated
-   * by the @authors tag. See the copyright.txt in the distribution for a
-   * full listing of individual contributors.
-   *
-   * This is free software; you can redistribute it and/or modify it
-   * under the terms of the GNU Lesser General Public License as
-   * published by the Free Software Foundation; either version 2.1 of
-   * the License, or (at your option) any later version.
-   *
-   * This software is distributed in the hope that it will be useful,
-   * but WITHOUT ANY WARRANTY; without even the implied warranty of
-   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   * Lesser General Public License for more details.
-   *
-   * You should have received a copy of the GNU Lesser General Public
-   * License along with this software; if not, write to the Free
-   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-   */
-
-package org.jboss.messaging.core.plugin.postoffice.cluster.jchannelfactory;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import org.jgroups.JChannel;
-
-/**
- * A JChannelFactory that will use the MBean JChannelFactory interface
- *
- * @author <a href="mailto:clebert.suconic at jboss.org">Clebert Suconic</a>
- * @version <tt>$Revision$</tt>
- * 
- * $Id$
- */
-public class MultiplexorJChannelFactory implements JChannelFactory
-{
-
-   // Constants
-   private static final String[] MUX_SIGNATURE = new String[]{"java.lang.String", "java.lang.String", "boolean", "java.lang.String"};
-
-   // Attributes
-   MBeanServer server;
-   ObjectName channelFactory;
-   String asyncStack;
-   String syncStack;
-   String uniqueID;
-   private static final String MUX_OPERATION = "createMultiplexerChannel";
-
-   // Static
-
-   // Constructors
-
-   public MultiplexorJChannelFactory(MBeanServer server,
-                                    ObjectName channelFactory,
-                                    String uniqueID,
-                                    String syncStack,
-                                    String asyncStack)
-   {
-      this.server = server;
-      this.channelFactory = channelFactory;
-      this.uniqueID = uniqueID;
-      this.asyncStack = asyncStack;
-      this.syncStack = syncStack;
-   }
-
-   // Public
-
-   public MBeanServer getServer()
-   {
-      return server;
-   }
-
-   public void setServer(MBeanServer server)
-   {
-      this.server = server;
-   }
-
-   public ObjectName getChannelFactory()
-   {
-      return channelFactory;
-   }
-
-   public void setChannelFactory(ObjectName channelFactory)
-   {
-      this.channelFactory = channelFactory;
-   }
-
-   public String getAsyncStack()
-   {
-      return asyncStack;
-   }
-
-   public void setAsyncStack(String asyncStack)
-   {
-      this.asyncStack = asyncStack;
-   }
-
-   public String getSyncStack()
-   {
-      return syncStack;
-   }
-
-   public void setSyncStack(String syncStack)
-   {
-      this.syncStack = syncStack;
-   }
-
-   public String getUniqueID()
-   {
-      return uniqueID;
-   }
-
-   public void setUniqueID(String uniqueID)
-   {
-      this.uniqueID = uniqueID;
-   }
-
-   public JChannel createSyncChannel() throws Exception
-   {
-      return (JChannel) server.invoke(this.channelFactory, MUX_OPERATION, new Object[]{syncStack, uniqueID, Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
-   }
-
-   public JChannel createASyncChannel() throws Exception
-   {
-      return (JChannel) server.invoke(this.channelFactory, MUX_OPERATION, new Object[]{asyncStack, uniqueID, Boolean.TRUE, uniqueID}, MUX_SIGNATURE);
-   }
-
-   // Package protected
-
-   // Protected
-
-   // Private
-
-   // Inner classes
-
-}

Modified: trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-01-08 20:44:43 UTC (rev 1921)
+++ trunk/tests/src/org/jboss/test/messaging/tools/ServerManagement.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -415,7 +415,7 @@
       }
 
       // As there is a problem with Multicast and JGroups on Linux (in certain JDKs)
-      // The stack introduced by multiplexor might fail under Linux if we don't have this
+      // The stack introduced by multiplexer might fail under Linux if we don't have this
       if (System.getProperty("os.name").equals("Linux"))
       {
          sb.append(" -Djava.net.preferIPv4Stack=true ");

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-01-08 20:44:43 UTC (rev 1921)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -399,6 +399,10 @@
 
          loadJNDIContexts();
 
+         // it will aways install the multiplexer as this is a chep operation.
+         // The actual JChannels are started only over demand
+         startMultiplexer();
+
          log.debug("loaded JNDI context");
 
          String transport = config.getRemotingTransport();
@@ -1321,6 +1325,33 @@
       }
    }
 
+   private void startMultiplexer()
+      throws Exception
+   {
+      log.info("Starting multiplexer");
+      String multiplexerConfigFile = "server/default/deploy/multiplexer-service.xml";
+      URL multiplexerCofigURL = getClass().getClassLoader().getResource(multiplexerConfigFile);
+      if (multiplexerCofigURL == null)
+      {
+         throw new Exception("Cannot find " + multiplexerCofigURL + " in the classpath");
+      }
+      ServiceDeploymentDescriptor multiplexerDD = new ServiceDeploymentDescriptor(multiplexerCofigURL);
+      List services = multiplexerDD.query("name","Multiplexer");
+      if (services.isEmpty())
+      {
+         log.info("Couldn't find multiplexer config");
+      }
+      else
+      {
+         log.info("Could find multiplexer config");
+      }
+
+      MBeanConfigurationElement multiplexerConfig = (MBeanConfigurationElement)services.iterator().next();
+      ObjectName nameMultiplexer = registerAndConfigureService(multiplexerConfig);
+      invoke(nameMultiplexer,"create", new Object[0], new String[0]);
+      invoke(nameMultiplexer,"start", new Object[0], new String[0]);
+   }
+
    private void parseConfig(String config)
    {
       config = config.toLowerCase();

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2007-01-08 20:44:43 UTC (rev 1921)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/rmi/LocalTestServer.java	2007-01-08 22:36:20 UTC (rev 1922)
@@ -297,33 +297,6 @@
             throw new Exception("Cannot find " + mainConfigFile + " in the classpath");
          }
 
-         if (clustered)
-         {
-            log.info("Starting multiplexer");
-            String multiplexerConfigFile = "server/default/deploy/multiplexer-service.xml";
-            URL multiplexerCofigURL = getClass().getClassLoader().getResource(multiplexerConfigFile);
-            if (multiplexerCofigURL == null)
-            {
-               throw new Exception("Cannot find " + multiplexerCofigURL + " in the classpath");
-            }
-            ServiceDeploymentDescriptor multiplexerDD = new ServiceDeploymentDescriptor(multiplexerCofigURL);
-            List services = multiplexerDD.query("name","Multiplexer");
-            if (services.isEmpty())
-            {
-               log.info("Couldn't find multiplexer config");
-            }
-            else
-            {
-               log.info("Could find multiplexer config");
-            }
-
-            MBeanConfigurationElement multiplexerConfig = (MBeanConfigurationElement)services.iterator().next();
-            ObjectName nameMultiplexer = sc.registerAndConfigureService(multiplexerConfig);
-            sc.invoke(nameMultiplexer,"create", new Object[0], new String[0]);
-            sc.invoke(nameMultiplexer,"start", new Object[0], new String[0]);
-
-         }
-
          String databaseType = sc.getDatabaseType();
          String persistenceConfigFile;
 




More information about the jboss-cvs-commits mailing list