summaryrefslogtreecommitdiff
path: root/java/client
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2012-02-27 23:43:02 +0000
committerRobert Godfrey <rgodfrey@apache.org>2012-02-27 23:43:02 +0000
commit6e147e4d0e8bd2a2fe5ec54c74b2a27c7bd67daa (patch)
treeba16071260a8e9f4adee079290ba89e83f1360d5 /java/client
parent2fb2ccb0b45e5b5ab62705570fa18f72eec1ffd5 (diff)
downloadqpid-python-6e147e4d0e8bd2a2fe5ec54c74b2a27c7bd67daa.tar.gz
QPID-2621 : [Java Client] Calling QueueBrowser.getEnumeration on a stopped connection will hang
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1294397 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java b/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
index bd83e8b37b..0c6031ea91 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
@@ -132,6 +132,10 @@ public class AMQQueueBrowser implements QueueBrowser
public Enumeration getEnumeration() throws JMSException
{
checkState();
+ if(!_session.getAMQConnection().started())
+ {
+ throw new IllegalStateException("Cannot enumerate message on the queue while the Connection is stopped");
+ }
final BasicMessageConsumer consumer =
(BasicMessageConsumer) _session.createBrowserConsumer(_queue, _messageSelector, false);