[jboss-cvs] JBoss Messaging SVN: r5101 - branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Oct 10 11:22:52 EDT 2008


Author: clebert.suconic at jboss.com
Date: 2008-10-10 11:22:52 -0400 (Fri, 10 Oct 2008)
New Revision: 5101

Modified:
   branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java
Log:
Adding test trying to replicate two serial slow consumers 

Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java	2008-10-10 14:29:11 UTC (rev 5100)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionFactoryTest.java	2008-10-10 15:22:52 UTC (rev 5101)
@@ -72,8 +72,7 @@
     */
    public void testQueueConnectionFactory() throws Exception
    {
-      QueueConnectionFactory qcf =
-         (QueueConnectionFactory)ic.lookup("/ConnectionFactory");
+      QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("/ConnectionFactory");
       QueueConnection qc = qcf.createQueueConnection();
       qc.close();
    }
@@ -84,8 +83,7 @@
     */
    public void testTopicConnectionFactory() throws Exception
    {
-      TopicConnectionFactory qcf =
-         (TopicConnectionFactory)ic.lookup("/ConnectionFactory");
+      TopicConnectionFactory qcf = (TopicConnectionFactory)ic.lookup("/ConnectionFactory");
       TopicConnection tc = qcf.createTopicConnection();
       tc.close();
    }
@@ -94,21 +92,19 @@
    {
       // deploy a connection factory that has an administatively configured clientID
 
-      String mbeanConfig =
-         "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" +
-         "       name=\"jboss.messaging.connectionfactory:service=TestConnectionFactory\"\n" +
-         "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n" +
-         "       <constructor>\n" +
-         "           <arg type=\"java.lang.String\" value=\"sofiavergara\"/>\n" +
-         "       </constructor>\n" +
-         "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n" +
-         "       <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n" +
-         "       <attribute name=\"JNDIBindings\">\n" +
-         "          <bindings>\n" +
-         "            <binding>/TestConnectionFactory</binding>\n" +
-         "          </bindings>\n" +
-         "       </attribute>\n" +
-         " </mbean>";
+      String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + "       name=\"jboss.messaging.connectionfactory:service=TestConnectionFactory\"\n"
+                           + "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+                           + "       <constructor>\n"
+                           + "           <arg type=\"java.lang.String\" value=\"sofiavergara\"/>\n"
+                           + "       </constructor>\n"
+                           + "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+                           + "       <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+                           + "       <attribute name=\"JNDIBindings\">\n"
+                           + "          <bindings>\n"
+                           + "            <binding>/TestConnectionFactory</binding>\n"
+                           + "          </bindings>\n"
+                           + "       </attribute>\n"
+                           + " </mbean>";
 
       ObjectName on = ServerManagement.deploy(mbeanConfig);
       ServerManagement.invoke(on, "create", new Object[0], new String[0]);
@@ -125,34 +121,31 @@
          fail("should throw exception");
 
       }
-      catch(javax.jms.IllegalStateException e)
+      catch (javax.jms.IllegalStateException e)
       {
          // OK
       }
 
-      //Now try and deploy another one with the same client id
+      // Now try and deploy another one with the same client id
 
-      mbeanConfig =
-         "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" +
-         "       name=\"jboss.messaging.connectionfactory:service=TestConnectionFactory2\"\n" +
-         "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n" +
-         "       <constructor>\n" +
-         "           <arg type=\"java.lang.String\" value=\"sofiavergara\"/>\n" +
-         "       </constructor>\n" +
-         "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n" +
-         "       <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n" +
-         "       <attribute name=\"JNDIBindings\">\n" +
-         "          <bindings>\n" +
-         "            <binding>/TestConnectionFactory2</binding>\n" +
-         "          </bindings>\n" +
-         "       </attribute>\n" +
-         " </mbean>";
+      mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + "       name=\"jboss.messaging.connectionfactory:service=TestConnectionFactory2\"\n"
+                    + "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n"
+                    + "       <constructor>\n"
+                    + "           <arg type=\"java.lang.String\" value=\"sofiavergara\"/>\n"
+                    + "       </constructor>\n"
+                    + "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n"
+                    + "       <depends optional-attribute-name=\"Connector\">jboss.messaging:service=Connector,transport=bisocket</depends>\n"
+                    + "       <attribute name=\"JNDIBindings\">\n"
+                    + "          <bindings>\n"
+                    + "            <binding>/TestConnectionFactory2</binding>\n"
+                    + "          </bindings>\n"
+                    + "       </attribute>\n"
+                    + " </mbean>";
 
       ObjectName on2 = ServerManagement.deploy(mbeanConfig);
       ServerManagement.invoke(on2, "create", new Object[0], new String[0]);
       ServerManagement.invoke(on2, "start", new Object[0], new String[0]);
 
-
       ServerManagement.invoke(on2, "stop", new Object[0], new String[0]);
       ServerManagement.invoke(on2, "destroy", new Object[0], new String[0]);
       ServerManagement.undeploy(on2);
@@ -165,10 +158,11 @@
       }
       catch (JMSException e)
       {
-         //Ok
+         // Ok
       }
 
-      if (c2 != null) c2.close();
+      if (c2 != null)
+         c2.close();
 
       c.close();
 
@@ -179,7 +173,7 @@
 
    public void testAdministrativelyConfiguredConnectors() throws Exception
    {
-      //Deploy a few connectors
+      // Deploy a few connectors
       String name1 = "jboss.messaging:service=Connector1,transport=bisocket";
 
       String name2 = "jboss.messaging:service=Connector2,transport=bisocket";
@@ -190,13 +184,28 @@
       ObjectName c2 = deployConnector(1235, name2);
       ObjectName c3 = deployConnector(1236, name3);
 
-      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory1", name1, "/TestConnectionFactory1", "clientid1", false);
-      ObjectName cf2 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory2", name2, "/TestConnectionFactory2", "clientid2", false);
-      ObjectName cf3 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory3", name3, "/TestConnectionFactory3", "clientid3", false);
-      //Last one shares the same connector
-      ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4", name3, "/TestConnectionFactory4", "clientid4", false);
+      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory1",
+                                               name1,
+                                               "/TestConnectionFactory1",
+                                               "clientid1",
+                                               false);
+      ObjectName cf2 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory2",
+                                               name2,
+                                               "/TestConnectionFactory2",
+                                               "clientid2",
+                                               false);
+      ObjectName cf3 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory3",
+                                               name3,
+                                               "/TestConnectionFactory3",
+                                               "clientid3",
+                                               false);
+      // Last one shares the same connector
+      ObjectName cf4 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory4",
+                                               name3,
+                                               "/TestConnectionFactory4",
+                                               "clientid4",
+                                               false);
 
-
       JBossConnectionFactory f1 = (JBossConnectionFactory)ic.lookup("/TestConnectionFactory1");
       ClientConnectionFactoryDelegate del1 = (ClientConnectionFactoryDelegate)f1.getDelegate();
 
@@ -227,7 +236,7 @@
       stopService(cf2);
       stopService(cf3);
 
-      //Check f4 is still ok
+      // Check f4 is still ok
       Connection conn5 = f4.createConnection();
       conn5.close();
 
@@ -270,7 +279,11 @@
    // Added for http://jira.jboss.org/jira/browse/JBMESSAGING-939
    public void testDurableSubscriptionOnPreConfiguredConnectionFactory() throws Exception
    {
-      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory1", ServiceContainer.REMOTING_OBJECT_NAME.getCanonicalName(), "/TestDurableCF", "cfTest", false);
+      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactory1",
+                                               ServiceContainer.REMOTING_OBJECT_NAME.getCanonicalName(),
+                                               "/TestDurableCF",
+                                               "cfTest",
+                                               false);
 
       ServerManagement.deployTopic("TestSubscriber");
 
@@ -278,19 +291,18 @@
 
       try
       {
-         Topic topic = (Topic) ic.lookup("/topic/TestSubscriber");
-         ConnectionFactory cf = (ConnectionFactory) ic.lookup("/TestDurableCF");
+         Topic topic = (Topic)ic.lookup("/topic/TestSubscriber");
+         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/TestDurableCF");
          conn = cf.createConnection();
 
          // I have to remove this asertion, as the test would work if doing this assertion
          // as getClientID performed some operation that cleared the bug condition during
          // the creation of this testcase
-         //assertEquals("cfTest", conn.getClientID());
+         // assertEquals("cfTest", conn.getClientID());
 
          Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-         session.createDurableSubscriber(topic,
-            "durableSubscriberChangeSelectorTest", "TEST = 'test'", false);
+         session.createDurableSubscriber(topic, "durableSubscriberChangeSelectorTest", "TEST = 'test'", false);
       }
       finally
       {
@@ -306,7 +318,6 @@
             log.warn(e.toString(), e);
          }
 
-
          try
          {
             stopService(cf1);
@@ -329,17 +340,19 @@
 
    }
 
-
    public void testSlowConsumers() throws Exception
    {
       ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactorySlowConsumers",
-      		                                   ServiceContainer.REMOTING_OBJECT_NAME.getCanonicalName(), "/TestSlowConsumersCF", null, true);
+                                               ServiceContainer.REMOTING_OBJECT_NAME.getCanonicalName(),
+                                               "/TestSlowConsumersCF",
+                                               null,
+                                               true);
 
       Connection conn = null;
 
       try
       {
-         ConnectionFactory cf = (ConnectionFactory) ic.lookup("/TestSlowConsumersCF");
+         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/TestSlowConsumersCF");
 
          conn = cf.createConnection();
 
@@ -353,31 +366,31 @@
 
          class FastListener implements MessageListener
          {
-         	volatile int processed;
+            volatile int processed;
 
-         	public void onMessage(Message msg)
-				{
-         		processed++;
+            public void onMessage(Message msg)
+            {
+               processed++;
 
-         		TextMessage tm = (TextMessage)msg;
+               TextMessage tm = (TextMessage)msg;
 
-         		try
-         		{
-         			log.info("Fast listener got message " + tm.getText());
-         		}
+               try
+               {
+                  log.info("Fast listener got message " + tm.getText());
+               }
                catch (JMSException e)
                {
                }
 
-         		if (processed == numMessages - 2)
-         		{
-         			synchronized (waitLock)
-         			{
-         				log.info("Notifying");
-         				waitLock.notifyAll();
-         			}
-         		}
-				}
+               if (processed == numMessages - 2)
+               {
+                  synchronized (waitLock)
+                  {
+                     log.info("Notifying");
+                     waitLock.notifyAll();
+                  }
+               }
+            }
          }
 
          final FastListener fast = new FastListener();
@@ -386,15 +399,15 @@
          {
             volatile int processed;
 
-				public void onMessage(Message msg)
-				{
+            public void onMessage(Message msg)
+            {
                TextMessage tm = (TextMessage)msg;
-               
+
                processed++;
 
                try
                {
-               	log.info("Slow listener got message " + tm.getText());
+                  log.info("Slow listener got message " + tm.getText());
                }
                catch (JMSException e)
                {
@@ -402,25 +415,25 @@
 
                synchronized (waitLock)
                {
-               	//Should really cope with spurious wakeups
-               	while (fast.processed != numMessages - 2)
-               	{
-               		log.info("Waiting");
-               		try
-               		{
-               			waitLock.wait(20000);
-               		}
-               		catch (InterruptedException e)
-               		{
-               		}
-               		log.info("Waited");
-               	}
-               	
-               	waitLock.notify();
+                  // Should really cope with spurious wakeups
+                  while (fast.processed != numMessages - 2)
+                  {
+                     log.info("Waiting");
+                     try
+                     {
+                        waitLock.wait(20000);
+                     }
+                     catch (InterruptedException e)
+                     {
+                     }
+                     log.info("Waited");
+                  }
+
+                  waitLock.notify();
                }
-				}
+            }
          }
-         
+
          final SlowListener slow = new SlowListener();
 
          MessageConsumer cons1 = session1.createConsumer(queue1);
@@ -431,7 +444,6 @@
 
          cons2.setMessageListener(fast);
 
-
          Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
          MessageProducer prod = sessSend.createProducer(queue1);
@@ -440,35 +452,36 @@
 
          for (int i = 0; i < numMessages; i++)
          {
-         	TextMessage tm = sessSend.createTextMessage("message" + i);
+            TextMessage tm = sessSend.createTextMessage("message" + i);
 
-         	prod.send(tm);
+            prod.send(tm);
          }
 
-         //All the messages bar one should be consumed by the fast listener  - since the slow listener shouldn't buffer any.
+         // All the messages bar one should be consumed by the fast listener - since the slow listener shouldn't buffer
+         // any.
 
          synchronized (waitLock)
          {
-         	//Should really cope with spurious wakeups
-         	while (fast.processed != numMessages - 2)
-         	{
-         		log.info("Waiting");
-         		waitLock.wait(20000);
-         		log.info("Waited");
-         	}
-         	
-         	while (slow.processed != 2)
+            // Should really cope with spurious wakeups
+            while (fast.processed != numMessages - 2)
             {
                log.info("Waiting");
                waitLock.wait(20000);
                log.info("Waited");
             }
+
+            while (slow.processed != 2)
+            {
+               log.info("Waiting");
+               waitLock.wait(20000);
+               log.info("Waited");
+            }
          }
 
          assertTrue(fast.processed == numMessages - 2);
-         
-        // Thread.sleep(10000);
-         
+
+         // Thread.sleep(10000);
+
       }
       finally
       {
@@ -476,7 +489,7 @@
          {
             if (conn != null)
             {
-            	log.info("Closing connection");
+               log.info("Closing connection");
                conn.close();
                log.info("Closed connection");
             }
@@ -486,9 +499,103 @@
             log.warn(e.toString(), e);
          }
 
+         try
+         {
+            stopService(cf1);
+         }
+         catch (Exception e)
+         {
+            log.warn(e.toString(), e);
+         }
 
+      }
+
+   }
+
+   public void testTwoSerialSlowConsumers() throws Exception
+   {
+      ObjectName cf1 = deployConnectionFactory("jboss.messaging.destination:service=TestConnectionFactorySlowConsumers",
+                                               ServiceContainer.REMOTING_OBJECT_NAME.getCanonicalName(),
+                                               "/TestSlowConsumersCF",
+                                               null,
+                                               true);
+
+      Connection conn = null;
+
+      Session session1 = null;
+      MessageConsumer cons1 = null;
+      
+      Session session2 = null;
+      MessageConsumer cons2 = null;
+      
+      try
+      {
+         ConnectionFactory cf = (ConnectionFactory)ic.lookup("/TestSlowConsumersCF");
+
+         conn = cf.createConnection();
+
+         Session sessSend = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
+         MessageProducer prod = sessSend.createProducer(queue1);
+
+         for (int i = 1; i <= 2; i++)
+         {
+            TextMessage tm = sessSend.createTextMessage("message " + i);
+            prod.send(tm);
+         }
+
+         conn.start();
+
+         session1 = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
+         cons1 = session1.createConsumer(queue1);
+
+         
+         TextMessage tm = (TextMessage)cons1.receive(1000);
+         assertNotNull(tm);
+         assertEquals("message 1", tm.getText());
+
+         session2 = conn.createSession(true, Session.AUTO_ACKNOWLEDGE);
+         cons2 = session2.createConsumer(queue1);
+
+         tm = (TextMessage)cons2.receive(1000);
+         assertNotNull(tm);
+         assertEquals("message 2", tm.getText());
+
+
+      }
+      finally
+      {
+         if (session1 != null && session2 != null)
+         {
+            session1.commit();
+            session2.commit();
+            
+            if (checkNoMessageData())
+            {
+               while (cons1.receive(100) != null);
+               while (cons2.receive(100) != null);
+
+               session1.commit();
+               session2.commit();
+            }
+            
+         }
+
          try
          {
+            if (conn != null)
+            {
+               log.info("Closing connection");
+               conn.close();
+               log.info("Closed connection");
+            }
+         }
+         catch (Exception e)
+         {
+            log.warn(e.toString(), e);
+         }
+
+         try
+         {
             stopService(cf1);
          }
          catch (Exception e)
@@ -499,97 +606,107 @@
       }
 
    }
-   
-   
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------
 
    // Private -------------------------------------------------------
-   
+
    private ObjectName deployConnector(int port, String name) throws Exception
    {
-      String mbeanConfig =
-         "<mbean code=\"org.jboss.remoting.transport.Connector\"\n" +
-         " name=\"" +name + "\"\n" +
-         " display-name=\"BiSocket transport Connector\">\n"  +        
-     "</mbean>";
-      
-      String config =
-         "<attribute name=\"Configuration\">\n" +         
-	         "<config>" +
-			      "<invoker transport=\"bisocket\">" +
-			                
-			         "<attribute name=\"marshaller\" isParam=\"true\">org.jboss.jms.wireformat.JMSWireFormat</attribute>" +
-			         "<attribute name=\"unmarshaller\" isParam=\"true\">org.jboss.jms.wireformat.JMSWireFormat</attribute>" +
-			         "<attribute name=\"dataType\" isParam=\"true\">jms</attribute>" +
-			         "<attribute name=\"socket.check_connection\" isParam=\"true\">false</attribute>" +
-			         "<attribute name=\"timeout\" isParam=\"true\">0</attribute>" +
-			         "<attribute name=\"serverBindAddress\">localhost</attribute>" +
-			         "<attribute name=\"serverBindPort\">" + port + "</attribute>" +
-			         "<attribute name=\"clientSocketClass\" isParam=\"true\">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>"+
-			         "<attribute name=\"serverSocketClass\" isParam=\"true\">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>" +
-			         "<attribute name=\"numberOfCallRetries\" isParam=\"true\">1</attribute>" +
-			         "<attribute name=\"pingFrequency\" isParam=\"true\">214748364</attribute>" +
-			         "<attribute name=\"pingWindowFactor\" isParam=\"true\">10</attribute>" +
-			         "<attribute name=\"onewayThreadPool\">org.jboss.jms.server.remoting.DirectThreadPool</attribute>" +
-			                                     
-			         "<attribute name=\"clientLeasePeriod\" isParam=\"true\">10000</attribute>" +
-			
-			         "<attribute name=\"numberOfRetries\" isParam=\"true\">10</attribute>" +
-			         "<attribute name=\"JBM_clientMaxPoolSize\" isParam=\"true\">200</attribute>" +        
-			                        
-			      "</invoker>" +
-			      "<handlers>" +
-			         "<handler subsystem=\"JMS\">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>" +
-			      "</handlers>" +
-			   "</config>" +
-        "</attribute>\n";
-      
+      String mbeanConfig = "<mbean code=\"org.jboss.remoting.transport.Connector\"\n" + " name=\"" +
+                           name +
+                           "\"\n" +
+                           " display-name=\"BiSocket transport Connector\">\n" +
+                           "</mbean>";
+
+      String config = "<attribute name=\"Configuration\">\n" + "<config>" +
+                      "<invoker transport=\"bisocket\">" +
+
+                      "<attribute name=\"marshaller\" isParam=\"true\">org.jboss.jms.wireformat.JMSWireFormat</attribute>" +
+                      "<attribute name=\"unmarshaller\" isParam=\"true\">org.jboss.jms.wireformat.JMSWireFormat</attribute>" +
+                      "<attribute name=\"dataType\" isParam=\"true\">jms</attribute>" +
+                      "<attribute name=\"socket.check_connection\" isParam=\"true\">false</attribute>" +
+                      "<attribute name=\"timeout\" isParam=\"true\">0</attribute>" +
+                      "<attribute name=\"serverBindAddress\">localhost</attribute>" +
+                      "<attribute name=\"serverBindPort\">" +
+                      port +
+                      "</attribute>" +
+                      "<attribute name=\"clientSocketClass\" isParam=\"true\">org.jboss.jms.client.remoting.ClientSocketWrapper</attribute>" +
+                      "<attribute name=\"serverSocketClass\" isParam=\"true\">org.jboss.jms.server.remoting.ServerSocketWrapper</attribute>" +
+                      "<attribute name=\"numberOfCallRetries\" isParam=\"true\">1</attribute>" +
+                      "<attribute name=\"pingFrequency\" isParam=\"true\">214748364</attribute>" +
+                      "<attribute name=\"pingWindowFactor\" isParam=\"true\">10</attribute>" +
+                      "<attribute name=\"onewayThreadPool\">org.jboss.jms.server.remoting.DirectThreadPool</attribute>" +
+
+                      "<attribute name=\"clientLeasePeriod\" isParam=\"true\">10000</attribute>" +
+
+                      "<attribute name=\"numberOfRetries\" isParam=\"true\">10</attribute>" +
+                      "<attribute name=\"JBM_clientMaxPoolSize\" isParam=\"true\">200</attribute>" +
+
+                      "</invoker>" +
+                      "<handlers>" +
+                      "<handler subsystem=\"JMS\">org.jboss.jms.server.remoting.JMSServerInvocationHandler</handler>" +
+                      "</handlers>" +
+                      "</config>" +
+                      "</attribute>\n";
+
       ObjectName on = ServerManagement.deploy(mbeanConfig);
-      
+
       ServerManagement.setAttribute(on, "Configuration", config);
-            
+
       ServerManagement.invoke(on, "create", new Object[0], new String[0]);
-      
+
       ServerManagement.invoke(on, "start", new Object[0], new String[0]);
-      
+
       return on;
    }
-   
-   private ObjectName deployConnectionFactory(String name, String connectorName, String binding, String clientID, boolean slowConsumers) throws Exception
+
+   private ObjectName deployConnectionFactory(String name,
+                                              String connectorName,
+                                              String binding,
+                                              String clientID,
+                                              boolean slowConsumers) throws Exception
    {
-      String mbeanConfig =
-            "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" +
-            "       name=\"" + name + "\"\n" +
-            "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n" +
-            "       <constructor>\n" +
-            "           <arg type=\"java.lang.String\" value=\"" + clientID + "\"/>\n" +
-            "       </constructor>\n" +
-            "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n" +
-            "       <depends optional-attribute-name=\"Connector\">" + connectorName + "</depends>\n" +
-            "       <attribute name=\"JNDIBindings\">\n" +
-            "          <bindings>\n" +
-            "            <binding>" + binding + " </binding>\n" +
-            "          </bindings>\n" +
-            "       </attribute>\n" +
-            "       <attribute name=\"SlowConsumers\">" + slowConsumers + "</attribute>\n" +            
-            " </mbean>";
+      String mbeanConfig = "<mbean code=\"org.jboss.jms.server.connectionfactory.ConnectionFactory\"\n" + "       name=\"" + name +
+                           "\"\n" +
+                           "       xmbean-dd=\"xmdesc/ConnectionFactory-xmbean.xml\">\n" +
+                           "       <constructor>\n" +
+                           "           <arg type=\"java.lang.String\" value=\"" +
+                           clientID +
+                           "\"/>\n" +
+                           "       </constructor>\n" +
+                           "       <depends optional-attribute-name=\"ServerPeer\">jboss.messaging:service=ServerPeer</depends>\n" +
+                           "       <depends optional-attribute-name=\"Connector\">" +
+                           connectorName +
+                           "</depends>\n" +
+                           "       <attribute name=\"JNDIBindings\">\n" +
+                           "          <bindings>\n" +
+                           "            <binding>" +
+                           binding +
+                           " </binding>\n" +
+                           "          </bindings>\n" +
+                           "       </attribute>\n" +
+                           "       <attribute name=\"SlowConsumers\">" +
+                           slowConsumers +
+                           "</attribute>\n" +
+                           " </mbean>";
 
       ObjectName on = ServerManagement.deploy(mbeanConfig);
       ServerManagement.invoke(on, "create", new Object[0], new String[0]);
       ServerManagement.invoke(on, "start", new Object[0], new String[0]);
-      
+
       return on;
    }
-   
+
    private void stopService(ObjectName on) throws Exception
    {
       ServerManagement.invoke(on, "stop", new Object[0], new String[0]);
       ServerManagement.invoke(on, "destroy", new Object[0], new String[0]);
       ServerManagement.undeploy(on);
    }
-   
+
    // Inner classes -------------------------------------------------
 
 }




More information about the jboss-cvs-commits mailing list