summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/main
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2008-09-03 16:26:38 +0000
committerMartin Ritchie <ritchiem@apache.org>2008-09-03 16:26:38 +0000
commit03e2a3ab68f35e70967659b248709612b3a09a87 (patch)
tree97c9563c110bdaf4740c45d2aeacb9b7a5674d6e /qpid/java/broker/src/main
parent898c10ed8e9f04a7d919df1f8900779b5f5af725 (diff)
downloadqpid-python-03e2a3ab68f35e70967659b248709612b3a09a87.tar.gz
QPID-1266 : Provided test for new stop() method. Updated RefCountExService to allow retrieval of the referenceCount. Updated AMQQueue to only perform stop() actions once, such as releasing the RefCountExService. Updated instances where new virtualhosts were not added to the VHostRegistry. See supplemental JIRA for removing the need for this.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@691661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/main')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java13
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java7
2 files changed, 16 insertions, 4 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
index 1184ba1d19..6631bc3559 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
@@ -117,6 +117,7 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener
private final AtomicLong _stateChangeCount = new AtomicLong(Long.MIN_VALUE);
private AtomicReference _asynchronousRunner = new AtomicReference(null);
private AtomicInteger _deliveredMessages = new AtomicInteger();
+ private AtomicBoolean _stopped = new AtomicBoolean(false);
protected SimpleAMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
throws AMQException
@@ -1110,7 +1111,17 @@ public class SimpleAMQQueue implements AMQQueue, Subscription.StateListener
public void stop()
{
- ReferenceCountingExecutorService.getInstance().releaseExecutorService();
+ if (!_stopped.getAndSet(true))
+ {
+ ReferenceCountingExecutorService.getInstance().releaseExecutorService();
+ }
+ else
+ {
+ if(_logger.isDebugEnabled())
+ {
+ _logger.debug("Queue " + getName() + " already stopped");
+ }
+ }
}
public void deliverAsync()
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
index 71f6c8ed44..9229863c35 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
@@ -301,6 +301,10 @@ public class VirtualHost implements Accessable
public void close() throws Exception
{
+
+ //Stop Connections
+ _connectionRegistry.close();
+
//Stop the Queues processing
if (_queueRegistry != null)
{
@@ -316,9 +320,6 @@ public class VirtualHost implements Accessable
_houseKeepingTimer.cancel();
}
- //Stop Connections
- _connectionRegistry.close();
-
//Close MessageStore
if (_messageStore != null)
{