[jboss-cvs] JBoss Messaging SVN: r3768 - branches/Branch_Stable/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:20:16 EST 2008
Author: jmesnil
Date: 2008-02-22 10:20:16 -0500 (Fri, 22 Feb 2008)
New Revision: 3768
Modified:
branches/Branch_Stable/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
- set the factory refs according to the destination types (queue or topic)
Modified: branches/Branch_Stable/src/main/org/jboss/jms/server/bridge/BridgeService.java
===================================================================
--- branches/Branch_Stable/src/main/org/jboss/jms/server/bridge/BridgeService.java 2008-02-22 15:07:18 UTC (rev 3767)
+++ branches/Branch_Stable/src/main/org/jboss/jms/server/bridge/BridgeService.java 2008-02-22 15:20:16 UTC (rev 3768)
@@ -23,7 +23,11 @@
import java.util.Properties;
+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.contract.MessagingComponent;
import org.jboss.system.ServiceMBeanSupport;
@@ -313,9 +317,25 @@
Properties targetProps = (Properties)server.getAttribute(targetProviderLoader, "Properties");
- String sourceCFRef = (String)server.getAttribute(sourceProviderLoader, "FactoryRef");
+ // 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 targetCFRef = (String)server.getAttribute(targetProviderLoader, "FactoryRef");
+ String targetCFRef = (String)server.getAttribute(targetProviderLoader, targetFactoryRef);
ConnectionFactoryFactory sourceCff =
new JNDIConnectionFactoryFactory(sourceProps, sourceCFRef);
More information about the jboss-cvs-commits
mailing list