[jboss-cvs] JBoss Messaging SVN: r1912 - in trunk: src/main/org/jboss/messaging/core/plugin src/main/org/jboss/messaging/core/plugin/postoffice/cluster tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Jan 6 01:45:37 EST 2007


Author: ovidiu.feodorov at jboss.com
Date: 2007-01-06 01:45:30 -0500 (Sat, 06 Jan 2007)
New Revision: 1912

Modified:
   trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
   trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
   trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java
   trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
   trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
Log:
minor refactoring

Modified: trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java	2007-01-06 06:35:08 UTC (rev 1911)
+++ trunk/src/main/org/jboss/messaging/core/plugin/ClusteredPostOfficeService.java	2007-01-06 06:45:30 UTC (rev 1912)
@@ -331,9 +331,9 @@
          FilterFactory ff = new SelectorFactory();
          FailoverMapper mapper = new DefaultFailoverMapper();
 
-         JChannelFactory JChannelFactory = null;
+         JChannelFactory jChannelFactory = null;
 
-         if (this.channelFactoryName != null)
+         if (channelFactoryName != null)
          {
             Object info = null;
             try
@@ -347,19 +347,21 @@
             }
             if (info!=null)
             {
-               log.debug("*********************************** Using Multiplexor");
-               JChannelFactory = new MultiplexorJChannelFactory(server, channelFactoryName, channelPartitionName, syncChannelName, asyncChannelName);
+               log.debug(this + " uses multiplexor");
+               jChannelFactory =
+                  new MultiplexorJChannelFactory(server, channelFactoryName, channelPartitionName,
+                                                 syncChannelName, asyncChannelName);
             }
             else
             {
-               log.debug("*********************************** Using XMLJChannelFactory");
-               JChannelFactory = new XMLJChannelFactory(syncChannelConfig, asyncChannelConfig);
+               log.debug(this + " uses XMLJChannelFactory");
+               jChannelFactory = new XMLJChannelFactory(syncChannelConfig, asyncChannelConfig);
             }
          }
          else
          {
-            log.debug("*********************************** Using XMLJChannelFactory");
-            JChannelFactory = new XMLJChannelFactory(syncChannelConfig, asyncChannelConfig);
+            log.debug(this + " uses XMLJChannelFactory");
+            jChannelFactory = new XMLJChannelFactory(syncChannelConfig, asyncChannelConfig);
          }
 
          postOffice =  new DefaultClusteredPostOffice(ds, tm, sqlProperties,
@@ -367,7 +369,7 @@
                                                       nodeId, officeName, ms,
                                                       pm, tr, ff, cf, pool,
                                                       groupName,
-            JChannelFactory,
+                                                      jChannelFactory,
                                                       stateTimeout, castTimeout,
                                                       pullPolicy, rf,
                                                       mapper,

Modified: trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java	2007-01-06 06:35:08 UTC (rev 1911)
+++ trunk/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java	2007-01-06 06:45:30 UTC (rev 1912)
@@ -163,7 +163,7 @@
    private volatile boolean started;
    private volatile boolean stopping;
 
-   private JChannelFactory JChannelFactory;
+   private JChannelFactory jChannelFactory;
 
    private Channel syncChannel;
 
@@ -274,7 +274,7 @@
 
       viewExecutor = new QueuedExecutor();
 
-      this.JChannelFactory = JChannelFactory;
+      this.jChannelFactory = JChannelFactory;
    }
 
    // MessagingComponent overrides -----------------------------------------------------------------
@@ -288,8 +288,8 @@
 
       if (trace) { log.trace(this + " starting"); }
 
-      this.syncChannel = JChannelFactory.createSyncChannel();
-      this.asyncChannel = JChannelFactory.createASyncChannel();
+      this.syncChannel = jChannelFactory.createSyncChannel();
+      this.asyncChannel = jChannelFactory.createASyncChannel();
 
       // We don't want to receive local messages on any of the channels
       syncChannel.setOpt(Channel.LOCAL, Boolean.FALSE);

Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java	2007-01-06 06:35:08 UTC (rev 1911)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/DefaultRouterTest.java	2007-01-06 06:45:30 UTC (rev 1912)
@@ -31,7 +31,6 @@
 import org.jboss.messaging.core.FilterFactory;
 import org.jboss.messaging.core.Message;
 import org.jboss.messaging.core.MessageReference;
-import org.jboss.messaging.core.Queue;
 import org.jboss.messaging.core.Receiver;
 import org.jboss.messaging.core.SimpleDelivery;
 import org.jboss.messaging.core.plugin.contract.ClusteredPostOffice;
@@ -47,7 +46,6 @@
 import org.jboss.messaging.core.plugin.postoffice.cluster.MessagePullPolicy;
 import org.jboss.messaging.core.plugin.postoffice.cluster.NullMessagePullPolicy;
 import org.jboss.messaging.core.plugin.postoffice.cluster.QueueStats;
-import org.jboss.test.messaging.core.plugin.postoffice.cluster.NamedJChannelFactory;
 import org.jboss.messaging.core.tx.Transaction;
 import org.jboss.test.messaging.core.SimpleConditionFactory;
 import org.jboss.test.messaging.core.SimpleFilterFactory;
@@ -321,35 +319,33 @@
       receiver.clear();
    }
    
-   private void sendAndCheck(ClusterRouter router, Queue queue) throws Throwable
-   {
-      Message msg = CoreMessageFactory.createCoreMessage(nextId++, false, null);      
-      
-      MessageReference ref = ms.reference(msg);         
-      
-      Delivery del = router.handle(null, ref, null);
-      
-      assertNotNull(del);
-      
-      assertTrue(del.isSelectorAccepted());
-            
-      Thread.sleep(250);
-      
-      List msgs = queue.browse();
-      
-      assertNotNull(msgs);
-      
-      assertEquals(1, msgs.size());
-      
-      Message msgRec = (Message)msgs.get(0);
-      
-      assertTrue(msg == msgRec);  
-      
-      queue.removeAllReferences();
-   }
-   
-   
-   
+//   private void sendAndCheck(ClusterRouter router, Queue queue) throws Throwable
+//   {
+//      Message msg = CoreMessageFactory.createCoreMessage(nextId++, false, null);
+//
+//      MessageReference ref = ms.reference(msg);
+//
+//      Delivery del = router.handle(null, ref, null);
+//
+//      assertNotNull(del);
+//
+//      assertTrue(del.isSelectorAccepted());
+//
+//      Thread.sleep(250);
+//
+//      List msgs = queue.browse();
+//
+//      assertNotNull(msgs);
+//
+//      assertEquals(1, msgs.size());
+//
+//      Message msgRec = (Message)msgs.get(0);
+//
+//      assertTrue(msg == msgRec);
+//
+//      queue.removeAllReferences();
+//   }
+
    protected ClusteredPostOffice createClusteredPostOffice(int nodeId, String groupName) throws Exception
    {
       MessagePullPolicy redistPolicy = new NullMessagePullPolicy();

Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java	2007-01-06 06:35:08 UTC (rev 1911)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RecoveryTest.java	2007-01-06 06:45:30 UTC (rev 1912)
@@ -53,8 +53,8 @@
  *
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @version <tt>$Revision$</tt>
- *          <p/>
- *          $Id$
+ * 
+ * $Id$
  */
 public class RecoveryTest extends PostOfficeTestBase
 {

Modified: trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java	2007-01-06 06:35:08 UTC (rev 1911)
+++ trunk/tests/src/org/jboss/test/messaging/core/plugin/postoffice/cluster/RedistributionWithDefaultMessagePullPolicyTest.java	2007-01-06 06:45:30 UTC (rev 1912)
@@ -60,8 +60,8 @@
  *
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @version <tt>$Revision$</tt>
- *          <p/>
- *          $Id$
+ *
+ * $Id$
  */
 public class RedistributionWithDefaultMessagePullPolicyTest extends PostOfficeTestBase
 {




More information about the jboss-cvs-commits mailing list