camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1227155 - in /camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms: JmsComponent.java JmsConfiguration.java JmsEndpoint.java reply/PersistentQueueReplyManager.java
Date Wed, 04 Jan 2012 13:39:40 GMT
Author: ningjiang
Date: Wed Jan  4 13:39:40 2012
New Revision: 1227155

URL: http://svn.apache.org/viewvc?rev=1227155&view=rev
Log:
CAMEL-4839 Added replyToCacheLevelName option to specify the cache level on JMS reply to queue

Modified:
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
    camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java?rev=1227155&r1=1227154&r2=1227155&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
Wed Jan  4 13:39:40 2012
@@ -179,6 +179,10 @@ public class JmsComponent extends Defaul
     public void setCacheLevelName(String cacheName) {
         getConfiguration().setCacheLevelName(cacheName);
     }
+    
+    public void setReplyToCacheLevelName(String cacheName) {
+        getConfiguration().setReplyToCacheLevelName(cacheName);
+    }
 
     public void setClientId(String consumerClientId) {
         getConfiguration().setClientId(consumerClientId);

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?rev=1227155&r1=1227154&r2=1227155&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
Wed Jan  4 13:39:40 2012
@@ -126,6 +126,8 @@ public class JmsConfiguration implements
     private boolean disableTimeToLive;
     private ReplyToType replyToType;
     private boolean asyncConsumer;
+    // the cacheLevelName of reply manager
+    private String replyToCacheLevelName;
 
     public JmsConfiguration() {
     }
@@ -1207,5 +1209,13 @@ public class JmsConfiguration implements
     public void setAsyncConsumer(boolean asyncConsumer) {
         this.asyncConsumer = asyncConsumer;
     }
+    
+    public void setReplyToCacheLevelName(String name) {
+        this.replyToCacheLevelName = name;
+    }
+    
+    public String getReplyToCacheLevelName() {
+        return replyToCacheLevelName;
+    }
 
 }

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?rev=1227155&r1=1227154&r2=1227155&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
Wed Jan  4 13:39:40 2012
@@ -512,6 +512,11 @@ public class JmsEndpoint extends Default
     public String getCacheLevelName() {
         return getConfiguration().getCacheLevelName();
     }
+    
+    @ManagedAttribute
+    public String getReplyToCacheLevelName() {
+        return getConfiguration().getReplyToCacheLevelName();
+    }
 
     @ManagedAttribute
     public String getClientId() {
@@ -758,6 +763,11 @@ public class JmsEndpoint extends Default
     public void setCacheLevelName(String cacheName) {
         getConfiguration().setCacheLevelName(cacheName);
     }
+    
+    @ManagedAttribute
+    public void setReplyToCacheLevelName(String cacheName) {
+        getConfiguration().setReplyToCacheLevelName(cacheName);
+    }
 
     @ManagedAttribute
     public void setClientId(String consumerClientId) {

Modified: camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java?rev=1227155&r1=1227154&r2=1227155&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
(original)
+++ camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/PersistentQueueReplyManager.java
Wed Jan  4 13:39:40 2012
@@ -148,6 +148,12 @@ public class PersistentQueueReplyManager
         } else {
             throw new IllegalArgumentException("ReplyToType " + type + " is not supported
for persistent reply queues");
         }
+        
+        String replyToCacheLevelName = endpoint.getConfiguration().getReplyToCacheLevelName();
+        if (replyToCacheLevelName != null) {
+            answer.setCacheLevelName(replyToCacheLevelName);
+            log.debug("Setting the replyCacheLevel to be " + replyToCacheLevelName);
+        }
 
         DestinationResolver resolver = endpoint.getDestinationResolver();
         if (resolver == null) {



Mime
View raw message