Fixed CS. This closes #973

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2e3a2041
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2e3a2041
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2e3a2041

Branch: refs/heads/master
Commit: 2e3a2041fb66992448f177a1ace6f942a4cbef19
Parents: 43f184e
Author: Claus Ibsen <davscl...@apache.org>
Authored: Wed May 4 16:35:57 2016 +0200
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Wed May 4 16:35:57 2016 +0200

----------------------------------------------------------------------
 .../camel/component/jms/JmsConfiguration.java   | 22 +++++++-------------
 .../jms/reply/ReplyManagerSupport.java          | 19 ++---------------
 2 files changed, 10 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2e3a2041/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
 
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
index 77e0ea7..a6a8311 100644
--- 
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
+++ 
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
@@ -173,9 +173,12 @@ public class JmsConfiguration implements Cloneable {
     @UriParam(defaultValue = "1", label = "advanced",
             description = "Specify the limit for the number of consumers that 
are allowed to be idle at any given time.")
     private int idleConsumerLimit = 1;
-    @UriParam(defaultValue = "100", label = "advanced")
+    @UriParam(defaultValue = "100", label = "advanced",
+            description = "Interval in millis to sleep each time while waiting 
for provisional correlation id to be updated.")
     private long waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = 
100L;
-    @UriParam(defaultValue = "50", label = "advanced")
+    @UriParam(defaultValue = "50", label = "advanced",
+            description = "Number of times to wait for provisional correlation 
id to be updated to the actual correlation id when doing request/reply over JMS"
+                    + " and when the option useMessageIDAsCorrelationID is 
enabled.")
     private int waitForProvisionCorrelationToBeUpdatedCounter = 50;
     @UriParam(label = "consumer",
             description = "Specifies the maximum number of concurrent 
consumers when consuming from JMS (not for request/reply over JMS)."
@@ -1061,33 +1064,24 @@ public class JmsConfiguration implements Cloneable {
         this.idleConsumerLimit = idleConsumerLimit;
     }
 
-    /**
-     * Receives a counter that is used in conjunction with {@code 
waitForProvisionCorrelationToBeUpdatedThreadSleepingTime}
-     * @return waitForProvisionCorrelationToBeUpdatedCounter
-     */
     public int getWaitForProvisionCorrelationToBeUpdatedCounter() {
         return waitForProvisionCorrelationToBeUpdatedCounter;
     }
 
     /**
-     * Sets a counter that is used in conjunction with {@code 
waitForProvisionCorrelationToBeUpdatedThreadSleepingTime}
-     * @param counter
+     * Number of times to wait for provisional correlation id to be updated to 
the actual correlation id when doing request/reply over JMS
+     * and when the option useMessageIDAsCorrelationID is enabled.
      */
     public void setWaitForProvisionCorrelationToBeUpdatedCounter(int counter) {
         this.waitForProvisionCorrelationToBeUpdatedCounter = counter;
     }
 
-    /**
-     * Gets the sleeping time of the Thread when waiting for provision 
correlation to be updated.
-     * @return
-     */
     public long getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime() {
         return waitForProvisionCorrelationToBeUpdatedThreadSleepingTime;
     }
 
     /**
-     * Sets the sleeping time of the Thread when waiting for provision 
correlation to be updated.
-     * @param sleepingTime
+     * Interval in millis to sleep each time while waiting for provisional 
correlation id to be updated.
      */
     public void 
setWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime(long sleepingTime) {
         this.waitForProvisionCorrelationToBeUpdatedThreadSleepingTime = 
sleepingTime;

http://git-wip-us.apache.org/repos/asf/camel/blob/2e3a2041/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
----------------------------------------------------------------------
diff --git 
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
 
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
index 8a14d76..9e242e2 100644
--- 
a/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
+++ 
b/components/camel-jms/src/main/java/org/apache/camel/component/jms/reply/ReplyManagerSupport.java
@@ -19,7 +19,6 @@ package org.apache.camel.component.jms.reply;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
@@ -200,20 +199,6 @@ public abstract class ReplyManagerSupport extends 
ServiceSupport implements Repl
     protected abstract AbstractMessageListenerContainer 
createListenerContainer() throws Exception;
 
     /**
-     * @return waitForProvisionCorrelationToBeUpdated counter
-     */
-    private int getWaitForProvisionCorrelationToBeUpdatedCounter(){
-        return 
endpoint.getConfiguration().getWaitForProvisionCorrelationToBeUpdatedCounter();
-    }
-
-    /**
-     * @return waitForProvisionCorrelationToBeUpdated thread sleeping time
-     */
-    private long getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime(){
-        return 
endpoint.getConfiguration().getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime();
-    }
-
-    /**
      * <b>IMPORTANT:</b> This logic is only being used due to high performance 
in-memory only
      * testing using InOut over JMS. Its unlikely to happen in a real life 
situation with communication
      * to a remote broker, which always will be slower to send back reply, 
before Camel had a chance
@@ -233,10 +218,10 @@ public abstract class ReplyManagerSupport extends 
ServiceSupport implements Repl
         // wait up until configured values
         boolean done = false;
         int counter = 0;
-        while (!done && counter++ < 
getWaitForProvisionCorrelationToBeUpdatedCounter()) {
+        while (!done && counter++ < 
endpoint.getConfiguration().getWaitForProvisionCorrelationToBeUpdatedCounter()) 
{
             log.trace("Early reply not found handler at attempt {}. Waiting a 
bit longer.", counter);
             try {
-                
Thread.sleep(getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime());
+                
Thread.sleep(endpoint.getConfiguration().getWaitForProvisionCorrelationToBeUpdatedThreadSleepingTime());
             } catch (InterruptedException e) {
                 // ignore
             }

Reply via email to