[jboss-cvs] JBoss Messaging SVN: r1497 - branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 18 04:02:47 EDT 2006


Author: ron_sigal
Date: 2006-10-18 04:02:46 -0400 (Wed, 18 Oct 2006)
New Revision: 1497

Modified:
   branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
   branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java
Log:
JBMESSAGING-207: Can get Remoting transport from container.xml.

Modified: branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2006-10-18 07:57:20 UTC (rev 1496)
+++ branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2006-10-18 08:02:46 UTC (rev 1497)
@@ -178,8 +178,7 @@
    private boolean transaction;
    private boolean database;
    private boolean jca;
-   private boolean remotingSocket;
-   private boolean remotingMultiplex;
+   private boolean remoting;
    private boolean security;
 
    private List toUnbindAtExit;
@@ -343,14 +342,12 @@
                                    DEFAULTDS_MANAGED_CONNECTION_POOL_OBJECT_NAME);
             startWrapperDataSourceService();
          }
-         if (remotingSocket)
+         
+         if (remoting)
          {
-            startRemoting(false);
+            startRemoting();
          }
-         if (remotingMultiplex)
-         {
-            startRemoting(true);
-         }
+         
          if (security)
          {
             startSecurityManager();
@@ -373,9 +370,10 @@
 
          loadJNDIContexts();
 
+         String transport = config.getRemotingTransport();
          log.info("remoting = \"" +
-            (remotingSocket ? "socket" : (remotingMultiplex ? "multiplex" : "disabled")) + "\", " +
-            "serialization = \"" + "jms" + "\", " + 
+            (remoting ? transport : "disabled") + "\", " +
+            "serialization = \"" + config.getSerializationType() + "\", " + 
             "database = \"" + getDatabaseType() + "\"");
          log.debug(this + " started");
       }
@@ -971,7 +969,7 @@
       stopService(managedConnFactoryObjectName);
    }
 
-   private void startRemoting(boolean multiplex) throws Exception
+   private void startRemoting() throws Exception
    {
       SerializationStreamFactory.setManagerClassName(
                "jms", "org.jboss.jms.server.remoting.MessagingSerializationManager");
@@ -979,8 +977,8 @@
       RemotingJMXWrapper mbean;
 
       //String serializationType = config.getSerializationType();
-      
       String serializationType = "jms";
+      String transport = config.getRemotingTransport();
       
       String params = "/?marshaller=org.jboss.jms.server.remoting.JMSWireFormat&" +
                       "unmarshaller=org.jboss.jms.server.remoting.JMSWireFormat&" +
@@ -988,18 +986,10 @@
                       "dataType=jms&" +
                       "timeout=0&" +
                       "socket.check_connection=false&" +
-                      "leasePeriod=20000";
+                      "leasePeriod=20000&" +
+                      "callbackStore=org.jboss.remoting.callback.CallbackStore";
 
-      String locatorURI;
-      if (multiplex)
-      {
-         locatorURI = "multiplex://" + ipAddressOrHostName + ":9111" + params;
-      }
-      else
-      {
-         locatorURI = "socket://" + ipAddressOrHostName + ":9111" + params;
-      }
-
+      String locatorURI = transport + "://" + ipAddressOrHostName + ":9111" + params;
       log.debug("Using the following locator uri:" + locatorURI);
 
       InvokerLocator locator = new InvokerLocator(locatorURI);
@@ -1150,7 +1140,7 @@
             transaction = true;
             database = true;
             jca = true;
-            remotingSocket = true;
+            remoting = true;
             security = true;
          }
          else if ("transaction".equals(tok))
@@ -1179,22 +1169,13 @@
          }
          else if ("remoting".equals(tok))
          {
-            remotingSocket = true;
+            remoting = true;
             if (minus)
             {
-               remotingSocket = false;
+               remoting = false;
             }
 
          }
-         else if ("remoting-multiplex".equals(tok))
-         {
-            remotingMultiplex = true;
-            if (minus)
-            {
-               remotingMultiplex = false;
-            }
-
-         }
          else if ("security".equals(tok))
          {
             security = true;
@@ -1208,7 +1189,7 @@
             transaction = false;
             database = false;
             jca = false;
-            remotingSocket = false;
+            remoting = false;
             security = false;
          }
          else

Modified: branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java
===================================================================
--- branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java	2006-10-18 07:57:20 UTC (rev 1496)
+++ branches/Branch_HTTP_Experiment/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainerConfiguration.java	2006-10-18 08:02:46 UTC (rev 1497)
@@ -75,6 +75,7 @@
    private String database;
    private Map dbConfigurations;
    private String serializationType;
+   private String remotingTransport;
 
    // Constructors --------------------------------------------------
 
@@ -135,6 +136,14 @@
    {
       return serializationType;
    }
+   
+   /**
+    * @return the transport the container wants the Remoting Connector to use.
+    */
+   public String getRemotingTransport()
+   {
+      return remotingTransport;
+   }
 
    // Package protected ---------------------------------------------
 
@@ -147,6 +156,7 @@
       Reader reader = new InputStreamReader(is);
       String currentDatabase = null;
       String currentSerializationType = null;
+      String currentRemotingTransport = null;
 
       try
       {
@@ -185,6 +195,10 @@
                {
                   currentSerializationType = XMLUtil.getTextContent(n);
                }
+               else if ("remoting-transport".equals(name))
+               {
+                  currentRemotingTransport = XMLUtil.getTextContent(n);
+               }
                else
                {
                   throw new Exception("Unexpected child <" + name + "> of node " +
@@ -195,6 +209,7 @@
 
          setCurrentDatabase(currentDatabase);
          setCurrentSerializationType(currentSerializationType);
+         setCurrentRemotingTransport(currentRemotingTransport);
       }
       finally
       {
@@ -227,6 +242,16 @@
          serializationType = xmlConfigSerializationType;
       }
    }
+   
+   private void setCurrentRemotingTransport(String xmlRemotingTransport)
+   {
+      remotingTransport = System.getProperty("test.remotingTransport");
+      if (remotingTransport == null)
+      {
+         remotingTransport = xmlRemotingTransport;
+      }
+   }
+   
 
    private void validate() throws Exception
    {




More information about the jboss-cvs-commits mailing list