You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ro...@apache.org on 2015/10/05 12:19:40 UTC

[3/3] qpid-jms git commit: QPIDJMS-112: update javadocs and method sig for clarity

QPIDJMS-112: update javadocs and method sig for clarity


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/5c538a06
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/5c538a06
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/5c538a06

Branch: refs/heads/master
Commit: 5c538a0655dfe7ee607a39f4f31ae9a0c66a4a4b
Parents: 7a4b73b
Author: Robert Gemmell <ro...@apache.org>
Authored: Mon Oct 5 10:05:13 2015 +0100
Committer: Robert Gemmell <ro...@apache.org>
Committed: Mon Oct 5 10:09:14 2015 +0100

----------------------------------------------------------------------
 .../org/apache/qpid/jms/JmsMessageConsumer.java    | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/5c538a06/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
----------------------------------------------------------------------
diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
index 6500122..ba6c3df 100644
--- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
+++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/JmsMessageConsumer.java
@@ -255,7 +255,7 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
      * delivery count value but will continue to wait for the configured timeout.
      *
      * @throws JMSException
-     * @return null if we timeout or if the consumer is closed.
+     * @return null if we timeout or if the consumer is closed concurrently.
      */
     private JmsInboundMessageDispatch dequeue(long timeout) throws JMSException {
         boolean pullConsumer = isPullConsumer();
@@ -293,8 +293,8 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
                     //TODO: make it optional/configurable not to do this at all?
                     if (timeout >= 0) {
                         // We don't do this for receive with no timeout since it
-                        // already occurred for zero-prefetch consumers, and
-                        // the rest block indefinitely on the local messageQueue
+                        // is redundant: zero-prefetch consumers already pull, and
+                        // the rest block indefinitely on the local messageQueue.
                         pullForced = true;
                         performPullIfRequired(timeout, true);
                     }
@@ -660,7 +660,9 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
     }
 
     /**
-     * Triggers a pull request from the connected Provider with the given timeout value.
+     * Triggers a pull request from the connected Provider with the given timeout value
+     * if the consumer is a pull consumer or requested to be treated as one, and the
+     * local queue is still running, and is currently empty.
      * <p>
      * The timeout value can be one of:
      * <br>
@@ -670,10 +672,11 @@ public class JmsMessageConsumer implements MessageConsumer, JmsMessageAvailableC
      *
      * @param timeout
      *        The amount of time the pull request should remain valid.
-     * @param forcePull TODO
+     * @param treatAsPullConsumer
+     *        Treat the consumer as if it were a pull consumer, even if it isn't.
      */
-    protected void performPullIfRequired(long timeout, boolean forcePull) throws JMSException {
-        if ((isPullConsumer() || forcePull) && messageQueue.isRunning() && messageQueue.isEmpty()) {
+    protected void performPullIfRequired(long timeout, boolean treatAsPullConsumer) throws JMSException {
+        if ((isPullConsumer() || treatAsPullConsumer) && messageQueue.isRunning() && messageQueue.isEmpty()) {
             connection.pull(getConsumerId(), timeout);
         }
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org