summaryrefslogtreecommitdiff
path: root/qpid/java/broker-core
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2014-05-15 12:57:46 +0000
committerKeith Wall <kwall@apache.org>2014-05-15 12:57:46 +0000
commit2c802479f99ff5eeeb0958b0869c700f55c0e889 (patch)
treec3042fce3234bd15e4eaf2d5e5225e020695e44c /qpid/java/broker-core
parentef5392fe1f9df62f348c06cec47f71d8983d5e86 (diff)
downloadqpid-python-2c802479f99ff5eeeb0958b0869c700f55c0e889.tar.gz
QPID-5715: [Java Broker] Make virtualhostnode respect states ACTIVE and STOPPED
* Added test to ensure that the VHN can transit between ACTIVE <=> STOPPED * Fixed defect whereby the VHN could not be recovered in the STOPPED state. Added test case. * Fixed defct whereby on stopping a VHN, the DurableConfigurationStore would be left open. Work by me and Andrew MacBean <andymacbean@gmail.com>. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1594903 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-core')
-rw-r--r--qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java
index ca521f82df..2f8860a3a0 100644
--- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java
+++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhostnode/AbstractVirtualHostNode.java
@@ -211,9 +211,10 @@ public abstract class AbstractVirtualHostNode<X extends AbstractVirtualHostNode<
}
}
- @StateTransition( currentState = { State.ACTIVE, State.ERRORED }, desiredState = State.STOPPED )
+ @StateTransition( currentState = { State.ACTIVE, State.ERRORED, State.UNINITIALIZED }, desiredState = State.STOPPED )
protected void doStop()
{
+ closeConfigurationStore();
closeChildren();
_state.set(State.STOPPED);
}
@@ -221,12 +222,7 @@ public abstract class AbstractVirtualHostNode<X extends AbstractVirtualHostNode<
@Override
protected void onClose()
{
- DurableConfigurationStore configurationStore = getConfigurationStore();
- if (configurationStore != null)
- {
- configurationStore.closeConfigurationStore();
- getEventLogger().message(getConfigurationStoreLogSubject(), ConfigStoreMessages.CLOSE());
- }
+ closeConfigurationStore();
}
@Override
@@ -250,6 +246,16 @@ public abstract class AbstractVirtualHostNode<X extends AbstractVirtualHostNode<
}
}
+ private void closeConfigurationStore()
+ {
+ DurableConfigurationStore configurationStore = getConfigurationStore();
+ if (configurationStore != null)
+ {
+ configurationStore.closeConfigurationStore();
+ getEventLogger().message(getConfigurationStoreLogSubject(), ConfigStoreMessages.CLOSE());
+ }
+ }
+
protected abstract DurableConfigurationStore createConfigurationStore();
protected abstract void activate();