diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2008-09-03 16:26:38 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2008-09-03 16:26:38 +0000 |
| commit | b7c6b894b1a1bebc578a1a478cddda6edc5255ac (patch) | |
| tree | 7ccad027ab317df788d9acb346cd357a2f360b2d /java/broker/src/main | |
| parent | 2c82cdf278c35b61aaab5681f88269e36213a906 (diff) | |
| download | qpid-python-b7c6b894b1a1bebc578a1a478cddda6edc5255ac.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/qpid@691661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker/src/main')
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 13 | ||||
| -rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java | 7 |
2 files changed, 16 insertions, 4 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java index 1184ba1d19..6631bc3559 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java +++ b/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/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java index 71f6c8ed44..9229863c35 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java +++ b/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) { |
