activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r427656 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms: InboundQueueBridge.java InboundTopicBridge.java JmsQueueConnector.java JmsTopicConnector.java OutboundQueueBridge.java OutboundTopicBridge.java
Date Tue, 01 Aug 2006 17:31:48 GMT
Author: rajdavies
Date: Tue Aug  1 10:31:47 2006
New Revision: 427656

URL: http://svn.apache.org/viewvc?rev=427656&view=rev
Log:
Allow the local destination name to be set -
re this thread on the user list: http://www.nabble.com/JMS-to-JMS-Bridge-tf1901141.html#a5598457

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundQueueBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundTopicBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundQueueBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundTopicBridge.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundQueueBridge.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundQueueBridge.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundQueueBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundQueueBridge.java
Tue Aug  1 10:31:47 2006
@@ -28,12 +28,14 @@
 public class InboundQueueBridge extends QueueBridge{
        
     String inboundQueueName;
+    String localQueueName;
     /**
      * Constructor that takes a foriegn destination as an argument
      * @param inboundQueueName
      */
     public  InboundQueueBridge(String inboundQueueName){
        this.inboundQueueName = inboundQueueName;
+       this.localQueueName = inboundQueueName;
     }
     
     /**
@@ -54,6 +56,23 @@
      */
     public void setInboundQueueName(String inboundQueueName){
         this.inboundQueueName=inboundQueueName;
+        if (this.localQueueName == null){
+            this.localQueueName = inboundQueueName;
+        }
+    }
+
+    /**
+     * @return the localQueueName
+     */
+    public String getLocalQueueName(){
+        return localQueueName;
+    }
+
+    /**
+     * @param localQueueName the localQueueName to set
+     */
+    public void setLocalQueueName(String localQueueName){
+        this.localQueueName=localQueueName;
     }
     
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundTopicBridge.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundTopicBridge.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundTopicBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/InboundTopicBridge.java
Tue Aug  1 10:31:47 2006
@@ -28,12 +28,14 @@
 public class InboundTopicBridge extends TopicBridge{
        
     String inboundTopicName;
+    String localTopicName;
     /**
      * Constructor that takes a foriegn destination as an argument
      * @param inboundTopicName
      */
     public  InboundTopicBridge(String  inboundTopicName){
         this.inboundTopicName = inboundTopicName;
+        this.localTopicName = inboundTopicName;
     }
     
     /**
@@ -50,10 +52,27 @@
     }
 
     /**
-     * @param outboundTopicName The outboundTopicName to set.
+     * @param inboundTopicName 
      */
     public void setInboundTopicName(String inboundTopicName){
         this.inboundTopicName=inboundTopicName;
+        if(this.localTopicName==null){
+            this.localTopicName = inboundTopicName;
+        }
+    }
+
+    /**
+     * @return the localTopicName
+     */
+    public String getLocalTopicName(){
+        return localTopicName;
+    }
+
+    /**
+     * @param localTopicName the localTopicName to set
+     */
+    public void setLocalTopicName(String localTopicName){
+        this.localTopicName=localTopicName;
     }
     
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
Tue Aug  1 10:31:47 2006
@@ -263,8 +263,9 @@
             QueueSession localSession = localQueueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
             for(int i=0;i<inboundQueueBridges.length;i++){
                 InboundQueueBridge bridge=inboundQueueBridges[i];
-                String queueName=bridge.getInboundQueueName();
-                Queue activemqQueue=createActiveMQQueue(localSession,queueName);
+                String localQueueName=bridge.getLocalQueueName();
+                Queue activemqQueue=createActiveMQQueue(localSession,localQueueName);
+                String queueName = bridge.getInboundQueueName();
                 Queue foreignQueue=createForeignQueue(outboundSession,queueName);
                 bridge.setConsumerQueue(foreignQueue);
                 bridge.setProducerQueue(activemqQueue);
@@ -287,8 +288,9 @@
             QueueSession localSession = localQueueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
             for(int i=0;i<outboundQueueBridges.length;i++){
                 OutboundQueueBridge bridge=outboundQueueBridges[i];
+                String localQueueName=bridge.getLocalQueueName();              
+                Queue activemqQueue=createActiveMQQueue(localSession,localQueueName);
                 String queueName=bridge.getOutboundQueueName();
-                Queue activemqQueue=createActiveMQQueue(localSession,queueName);
                 Queue foreignQueue=createForeignQueue(outboundSession,queueName);
                 bridge.setConsumerQueue(activemqQueue);
                 bridge.setProducerQueue(foreignQueue);

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java
Tue Aug  1 10:31:47 2006
@@ -265,8 +265,9 @@
             TopicSession localSession = localTopicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
             for(int i=0;i<inboundTopicBridges.length;i++){
                 InboundTopicBridge bridge=inboundTopicBridges[i];
+                String localTopicName=bridge.getLocalTopicName();          
+                Topic activemqTopic=createActiveMQTopic(localSession,localTopicName);
                 String topicName=bridge.getInboundTopicName();
-                Topic activemqTopic=createActiveMQTopic(localSession,topicName);
                 Topic foreignTopic=createForeignTopic(outboundSession,topicName);
                 bridge.setConsumerTopic(foreignTopic);
                 bridge.setProducerTopic(activemqTopic);
@@ -289,8 +290,9 @@
             TopicSession localSession = localTopicConnection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
             for(int i=0;i<outboundTopicBridges.length;i++){
                 OutboundTopicBridge bridge=outboundTopicBridges[i];
+                String localTopicName=bridge.getLocalTopicName();
+                Topic activemqTopic=createActiveMQTopic(localSession,localTopicName);
                 String topicName=bridge.getOutboundTopicName();
-                Topic activemqTopic=createActiveMQTopic(localSession,topicName);
                 Topic foreignTopic=createForeignTopic(outboundSession,topicName);
                 bridge.setConsumerTopic(activemqTopic);
                 bridge.setProducerTopic(foreignTopic);

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundQueueBridge.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundQueueBridge.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundQueueBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundQueueBridge.java
Tue Aug  1 10:31:47 2006
@@ -28,12 +28,14 @@
 public class OutboundQueueBridge extends QueueBridge{
        
     String outboundQueueName;
+    String localQueueName;
     /**
      * Constructor that takes a foreign destination as an argument
      * @param outboundQueueName
      */
     public  OutboundQueueBridge(String  outboundQueueName){
         this.outboundQueueName = outboundQueueName;
+        this.localQueueName = outboundQueueName;
     }
     
     /**
@@ -54,6 +56,23 @@
      */
     public void setOutboundQueueName(String outboundQueueName){
         this.outboundQueueName=outboundQueueName;
+        if (this.localQueueName==null){
+            this.localQueueName=outboundQueueName;
+        }
+    }
+
+    /**
+     * @return the localQueueName
+     */
+    public String getLocalQueueName(){
+        return localQueueName;
+    }
+
+    /**
+     * @param localQueueName the localQueueName to set
+     */
+    public void setLocalQueueName(String localQueueName){
+        this.localQueueName=localQueueName;
     }
     
 }

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundTopicBridge.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundTopicBridge.java?rev=427656&r1=427655&r2=427656&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundTopicBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/OutboundTopicBridge.java
Tue Aug  1 10:31:47 2006
@@ -28,12 +28,14 @@
 public class OutboundTopicBridge extends TopicBridge{
        
     String outboundTopicName;
+    String localTopicName;
     /**
      * Constructor that takes a foreign destination as an argument
      * @param outboundTopicName
      */
     public  OutboundTopicBridge(String  outboundTopicName){
         this.outboundTopicName = outboundTopicName;
+        this.localTopicName = outboundTopicName;
     }
     
     /**
@@ -54,6 +56,23 @@
      */
     public void setOutboundTopicName(String outboundTopicName){
         this.outboundTopicName=outboundTopicName;
+        if(this.localTopicName==null){
+            this.localTopicName=outboundTopicName;
+        }
+    }
+
+    /**
+     * @return the localTopicName
+     */
+    public String getLocalTopicName(){
+        return localTopicName;
+    }
+
+    /**
+     * @param localTopicName the localTopicName to set
+     */
+    public void setLocalTopicName(String localTopicName){
+        this.localTopicName=localTopicName;
     }
     
 }



Mime
View raw message