From 18be2f3e3967c95e62d6f1308368fc5a669effec Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Mon, 27 Feb 2012 23:43:02 +0000 Subject: QPID-2621 : [Java Client] Calling QueueBrowser.getEnumeration on a stopped connection will hang git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1294397 13f79535-47bb-0310-9956-ffa450edef68 --- .../client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qpid/java/client') diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java b/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java index bd83e8b37b..0c6031ea91 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java +++ b/qpid/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); -- cgit v1.2.1