activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r375088 - in /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms: DestinationBridge.java JmsConnector.java JmsQueueConnector.java JmsTopicConnector.java
Date Sun, 05 Feb 2006 19:58:16 GMT
Author: rajdavies
Date: Sun Feb  5 11:58:14 2006
New Revision: 375088

URL: http://svn.apache.org/viewcvs?rev=375088&view=rev
Log:
seperate inbound and outbound message convertors

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.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

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java?rev=375088&r1=375087&r2=375088&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/DestinationBridge.java
Sun Feb  5 11:58:14 2006
@@ -56,15 +56,15 @@
     }
 
     /**
-     * @return Returns the jmsMessageConvertor.
+     * @return Returns the inboundMessageConvertor.
      */
     public JmsMesageConvertor getJmsMessageConvertor(){
         return jmsMessageConvertor;
     }
 
     /**
-     * @param jmsMessageConvertor
-     *            The jmsMessageConvertor to set.
+     * @param inboundMessageConvertor
+     *            The inboundMessageConvertor to set.
      */
     public void setJmsMessageConvertor(JmsMesageConvertor jmsMessageConvertor){
         this.jmsMessageConvertor=jmsMessageConvertor;
@@ -95,9 +95,6 @@
                     message.setJMSReplyTo(null);
                 }
                 Message converted=jmsMessageConvertor.convert(message);
-                if (converted == message && converted instanceof ActiveMQMessage){
-                    converted = (Message) ((ActiveMQMessage)converted).copy();
-                }
                 sendMessage(converted);
                 message.acknowledge();
             }catch(JMSException e){

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java?rev=375088&r1=375087&r2=375088&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsConnector.java
Sun Feb  5 11:58:14 2006
@@ -40,7 +40,8 @@
     private static final Log log=LogFactory.getLog(JmsConnector.class);
     protected JndiTemplate jndiLocalTemplate;
     protected JndiTemplate jndiOutboundTemplate;
-    protected JmsMesageConvertor jmsMessageConvertor;
+    protected JmsMesageConvertor inboundMessageConvertor;
+    protected JmsMesageConvertor outboundMessageConvertor;
     private List inboundBridges = new CopyOnWriteArrayList();
     private List outboundBridges = new CopyOnWriteArrayList();
     protected int replyToDestinationCacheSize=10000;
@@ -74,8 +75,11 @@
             if(jndiOutboundTemplate==null){
                 jndiOutboundTemplate=new JndiTemplate();
             }
-            if(jmsMessageConvertor==null){
-                jmsMessageConvertor=new SimpleJmsMessageConvertor();
+            if(inboundMessageConvertor==null){
+                inboundMessageConvertor=new SimpleJmsMessageConvertor();
+            }
+            if (outboundMessageConvertor==null){
+                outboundMessageConvertor=new SimpleJmsMessageConvertor();
             }
             replyToBridges.setMaxCacheSize(getReplyToDestinationCacheSize());
         }
@@ -148,18 +152,32 @@
     }
 
     /**
-     * @return Returns the jmsMessageConvertor.
+     * @return Returns the inboundMessageConvertor.
+     */
+    public JmsMesageConvertor getInboundMessageConvertor(){
+        return inboundMessageConvertor;
+    }
+
+    /**
+     * @param inboundMessageConvertor
+     *            The inboundMessageConvertor to set.
+     */
+    public void setInboundMessageConvertor(JmsMesageConvertor jmsMessageConvertor){
+        this.inboundMessageConvertor=jmsMessageConvertor;
+    }
+
+    /**
+     * @return Returns the outboundMessageConvertor.
      */
-    public JmsMesageConvertor getJmsMessageConvertor(){
-        return jmsMessageConvertor;
+    public JmsMesageConvertor getOutboundMessageConvertor(){
+        return outboundMessageConvertor;
     }
 
     /**
-     * @param jmsMessageConvertor
-     *            The jmsMessageConvertor to set.
+     * @param outboundMessageConvertor The outboundMessageConvertor to set.
      */
-    public void setJmsMessageConvertor(JmsMesageConvertor jmsMessageConvertor){
-        this.jmsMessageConvertor=jmsMessageConvertor;
+    public void setOutboundMessageConvertor(JmsMesageConvertor outboundMessageConvertor){
+        this.outboundMessageConvertor=outboundMessageConvertor;
     }
 
     /**

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsQueueConnector.java?rev=375088&r1=375087&r2=375088&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
Sun Feb  5 11:58:14 2006
@@ -339,7 +339,7 @@
                 bridge.setProducerConnection(localQueueConnection);
                 bridge.setConsumerConnection(outboundQueueConnection);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getInboundMessageConvertor());
                 }
                 bridge.setJmsQueueConnector(this);
                 addInboundBridge(bridge);
@@ -364,7 +364,7 @@
                 bridge.setConsumerConnection(localQueueConnection);
                 bridge.setDoHandleReplyTo(false);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getOutboundMessageConvertor());
                 }
                 bridge.setJmsQueueConnector(this);
                 addOutboundBridge(bridge);
@@ -393,7 +393,7 @@
                 bridge.setConsumerConnection(localQueueConnection);
                 bridge.setDoHandleReplyTo(false);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getOutboundMessageConvertor());
                 }
                 bridge.setJmsQueueConnector(this);
                 bridge.start();

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/jms/JmsTopicConnector.java?rev=375088&r1=375087&r2=375088&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
Sun Feb  5 11:58:14 2006
@@ -339,7 +339,7 @@
                 bridge.setProducerConnection(localTopicConnection);
                 bridge.setConsumerConnection(outboundTopicConnection);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getInboundMessageConvertor());
                 }
                 bridge.setJmsTopicConnector(this);
                 addInboundBridge(bridge);
@@ -364,7 +364,7 @@
                 bridge.setConsumerConnection(localTopicConnection);
                 bridge.setDoHandleReplyTo(false);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getOutboundMessageConvertor());
                 }
                 bridge.setJmsTopicConnector(this);
                 addOutboundBridge(bridge);
@@ -393,7 +393,7 @@
                 bridge.setConsumerConnection(localTopicConnection);
                 bridge.setDoHandleReplyTo(false);
                 if(bridge.getJmsMessageConvertor()==null){
-                    bridge.setJmsMessageConvertor(getJmsMessageConvertor());
+                    bridge.setJmsMessageConvertor(getOutboundMessageConvertor());
                 }
                 bridge.setJmsTopicConnector(this);
                 bridge.start();



Mime
View raw message