[jboss-cvs] JBoss Messaging SVN: r3771 - trunk/src/main/org/jboss/jms/server/bridge.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 22 10:34:18 EST 2008


Author: jmesnil
Date: 2008-02-22 10:34:18 -0500 (Fri, 22 Feb 2008)
New Revision: 3771

Modified:
   trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java
Log:
* http://jira.jboss.org/jira/browse/JBMESSAGING-1183 - Message Bridge use QueueFactoryRef or TopicFactoryRef instead of FactoryRef
  - copied from modif in Branch_Stable but kept the code commented for the moment

Modified: trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java	2008-02-22 15:28:04 UTC (rev 3770)
+++ trunk/src/main/org/jboss/jms/server/bridge/BridgeService.java	2008-02-22 15:34:18 UTC (rev 3771)
@@ -21,7 +21,11 @@
  */
 package org.jboss.jms.server.bridge;
 
+import javax.jms.Destination;
+import javax.jms.Topic;
 import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
 
 import org.jboss.messaging.core.MessagingComponent;
 import org.jboss.messaging.util.Logger;
@@ -311,11 +315,29 @@
      // Properties sourceProps = (Properties)server.getAttribute(sourceProviderLoader, "Properties");
       
      // Properties targetProps = (Properties)server.getAttribute(targetProviderLoader, "Properties");
+
+      /* 
+      // JBMESSAGING-1183: set the factory refs according to the destinations types
+      Context icSource = new InitialContext(sourceProps);      
+      Context icTarget = new InitialContext(targetProps);
+      Destination sourceDest = (Destination)icSource.lookup(sourceDestinationLookup);
+      Destination targetDest = (Destination)icTarget.lookup(targetDestinationLookup);
+      String sourceFactoryRef = "QueueFactoryRef";
+      if(sourceDest instanceof Topic)
+      {
+         sourceFactoryRef = "TopicFactoryRef";
+      }
+      String targetFactoryRef = "QueueFactoryRef";
+      if(targetDest instanceof Topic)
+      {
+         targetFactoryRef = "TopicFactoryRef";
+      }
+
+      String sourceCFRef = (String)server.getAttribute(sourceProviderLoader, sourceFactoryRef);
       
-      //String sourceCFRef = (String)server.getAttribute(sourceProviderLoader, "FactoryRef");
+      String targetCFRef = (String)server.getAttribute(targetProviderLoader, targetFactoryRef);
+      */
       
-      //String targetCFRef = (String)server.getAttribute(targetProviderLoader, "FactoryRef");
-      
       //ConnectionFactoryFactory sourceCff =
       //   new JNDIConnectionFactoryFactory(sourceProps, sourceCFRef);
       




More information about the jboss-cvs-commits mailing list