diff options
| author | Andrew MacBean <macbean@apache.org> | 2014-09-17 14:10:38 +0000 |
|---|---|---|
| committer | Andrew MacBean <macbean@apache.org> | 2014-09-17 14:10:38 +0000 |
| commit | 8f6819c5a0189dde5e16547ddd07ed6650801e55 (patch) | |
| tree | 66902a7b807e69eba4da7fac46a1babfbf4d61d4 /qpid/java/bdbstore/src | |
| parent | 91ab214370cc16360822ebc5dbe4024a5124c453 (diff) | |
| download | qpid-python-8f6819c5a0189dde5e16547ddd07ed6650801e55.tar.gz | |
QPID-6075: [Java Broker] Deleting VHN fails to delete underlying store files if VHN has not been started
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1625601 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/bdbstore/src')
2 files changed, 12 insertions, 20 deletions
diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfigurationStore.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfigurationStore.java index 2caa069891..59bc5aad88 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfigurationStore.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfigurationStore.java @@ -77,7 +77,6 @@ public class BDBConfigurationStore implements MessageStoreProvider, DurableConfi private EnvironmentFacade _environmentFacade; - private String _storeLocation; private ConfiguredObject<?> _parent; private final Class<? extends ConfiguredObject> _rootClass; private boolean _overwrite; @@ -106,7 +105,6 @@ public class BDBConfigurationStore implements MessageStoreProvider, DurableConfi if (_environmentFacade == null) { _environmentFacade = _environmentFacadeFactory.createEnvironmentFacade(parent); - _storeLocation = _environmentFacade.getStoreLocation(); _overwrite = overwrite; _initialRecords = initialRecords; } @@ -482,24 +480,22 @@ public class BDBConfigurationStore implements MessageStoreProvider, DurableConfi @Override public void onDelete(ConfiguredObject<?> parent) { - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug("Deleting store " + _storeLocation); - } - FileBasedSettings fileBasedSettings = (FileBasedSettings)parent; String storePath = fileBasedSettings.getStorePath(); if (storePath != null) { + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug("Deleting store " + storePath); + } + File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location " + storePath); } } - - _storeLocation = null; } private boolean isConfigurationStoreOpen() @@ -570,7 +566,7 @@ public class BDBConfigurationStore implements MessageStoreProvider, DurableConfi @Override public String getStoreLocation() { - return BDBConfigurationStore.this._storeLocation; + return ((FileBasedSettings)_parent).getStorePath(); } @Override diff --git a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java index 5facf616e5..66e98ac314 100644 --- a/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java +++ b/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java @@ -46,7 +46,6 @@ public class BDBMessageStore extends AbstractBDBMessageStore private EnvironmentFacade _environmentFacade; private ConfiguredObject<?> _parent; - private String _storeLocation; private long _persistentSizeLowThreshold; private long _persistentSizeHighThreshold; @@ -78,7 +77,6 @@ public class BDBMessageStore extends AbstractBDBMessageStore } _environmentFacade = _environmentFacadeFactory.createEnvironmentFacade(parent); - _storeLocation = _environmentFacade.getStoreLocation(); } } @@ -105,24 +103,22 @@ public class BDBMessageStore extends AbstractBDBMessageStore @Override public void onDelete(ConfiguredObject<?> parent) { - if (LOGGER.isDebugEnabled()) - { - LOGGER.debug("Deleting store " + _storeLocation); - } - FileBasedSettings fileBasedSettings = (FileBasedSettings)parent; String storePath = fileBasedSettings.getStorePath(); if (storePath != null) { + if (LOGGER.isDebugEnabled()) + { + LOGGER.debug("Deleting store " + storePath); + } + File configFile = new File(storePath); if (!FileUtils.delete(configFile, true)) { LOGGER.info("Failed to delete the store at location " + storePath); } } - - _storeLocation = null; } @Override @@ -167,6 +163,6 @@ public class BDBMessageStore extends AbstractBDBMessageStore @Override public String getStoreLocation() { - return _storeLocation; + return ((FileBasedSettings)_parent).getStorePath(); } } |
