qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1583597 [1/8] - in /qpid/trunk: ./ qpid/ qpid/cpp/src/ qpid/cpp/src/tests/ qpid/java/ qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/ qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleyd...
Date Tue, 01 Apr 2014 10:35:37 GMT
Author: kwall
Date: Tue Apr  1 10:35:33 2014
New Revision: 1583597

URL: http://svn.apache.org/r1583597
Log:
QPID-5653, QPID-5624: Remove support for virtual host xml and make message and configuration stores stateless.
This commit will temporarily break the UI


Added:
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader1_3.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader1_3.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/StoreUpgraderTest.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/StoreUpgraderTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreConfigurationTest.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreConfigurationTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStoreFactory.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStoreFactory.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/broker-plugins/jdbc-store/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStoreFactory.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStoreFactory.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SplitStoreTest.java
      - copied unchanged from r1583556, qpid/branches/java-broker-bdb-ha2/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SplitStoreTest.java
Removed:
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/MessageStoreCreatorTest.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/ExchangeConfiguration.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/QueueConfiguration.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/XmlConfigurationUtilities.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/plugins/
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/actors/
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreConstants.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStoreCreator.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/OperationalLoggingListener.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/State.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/StateManager.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/plugins/
    qpid/trunk/qpid/java/broker-core/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.JDBCConnectionProviderFactory
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/QueueConfigurationTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/plugins/
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/OperationalLoggingListenerTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/StateManagerTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/StandardVirtualHostTest.java
    qpid/trunk/qpid/java/lib/poms/commons-configuration-1.8.xml
    qpid/trunk/qpid/java/lib/poms/commons-digester-1.8.1.xml
    qpid/trunk/qpid/java/perftests/example/brokerconfig/virtualhosts.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb-settings.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-bdb.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem-settings.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-mem.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby-settings.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-derby.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-firewall-2.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-firewall-3.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-firewall.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests-settings.xml
    qpid/trunk/qpid/java/systests/etc/virtualhosts-systests.xml
Modified:
    qpid/trunk/   (props changed)
    qpid/trunk/qpid/   (props changed)
    qpid/trunk/qpid/cpp/src/   (props changed)
    qpid/trunk/qpid/cpp/src/CMakeLists.txt   (props changed)
    qpid/trunk/qpid/cpp/src/tests/   (props changed)
    qpid/trunk/qpid/java/   (props changed)
    qpid/trunk/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfiguredObjectRecord.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHost.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/EnvironmentFacadeFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeFactory.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/StoreUpgrade.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/UpgradeFrom4To5.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/UpgradeFrom5To6.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/UpgradeFrom6To7.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/UpgradeFrom7To8.java
    qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/upgrade/Upgrader.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreConfigurationTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreQuotaEventsTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/VirtualHostTest.java
    qpid/trunk/qpid/java/bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreTest.java
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBUpgradeTest.java
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HAClusterTwoNodeTest.java
    qpid/trunk/qpid/java/bdbstore/systests/src/main/java/org/apache/qpid/server/store/berkeleydb/HATestClusterCreator.java
    qpid/trunk/qpid/java/broker-core/pom.xml
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/PreferencesProviderRecoverer.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/startup/StoreUpgrader.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/configuration/store/MemoryConfigurationEntryStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/logging/subjects/MessageStoreLogSubject.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Model.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/Queue.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/VirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/AbstractConfiguredObject.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/BrokerAdapter.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/model/adapter/VirtualHostAdapter.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/DurableConfigurationStoreFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/JDBCConnectionProviderFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/MessageStoreFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PluggableFactoryLoader.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/PreferencesProviderFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/plugin/VirtualHostFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/AMQQueueFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/AbstractAuthenticationManager.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractJDBCMessageStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/AbstractMemoryMessageStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationRecoverer.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/DurableConfigurationStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/Event.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/JsonFileConfigStoreFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/MessageStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/store/NullMessageStore.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/util/MapValueConverter.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/DefaultUpgraderProvider.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/StandardVirtualHostFactory.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
    qpid/trunk/qpid/java/broker-core/src/main/resources/initial-config.json
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/startup/VirtualHostRecovererTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ConfigurationEntryStoreTestCase.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/configuration/store/ManagementModeStoreHandlerTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/logging/messages/AbstractTestMessages.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/VirtualHostTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/AMQQueueFactoryTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/queue/PriorityQueueListTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/AbstractDurableConfigurationStoreTestCase.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/EventManagerTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/JsonFileConfigStoreTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreQuotaEventsTestBase.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/MessageStoreTestCase.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMemoryMessageStoreFactory.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/util/BrokerTestHelper.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/DurableConfigurationRecovererTest.java
    qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
    qpid/trunk/qpid/java/broker-core/src/test/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
    qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControl.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/config/PlainConfigurationTest.java
    qpid/trunk/qpid/java/broker-plugins/access-control/src/test/java/org/apache/qpid/server/security/access/plugins/DefaultAccessControlTest.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStore.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/main/java/org/apache/qpid/server/store/derby/DerbyMessageStoreFactory.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreConfigurationTest.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreQuotaEventsTest.java
    qpid/trunk/qpid/java/broker-plugins/derby-store/src/test/java/org/apache/qpid/server/store/derby/DerbyMessageStoreTest.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/org/apache/qpid/server/store/jdbc/bonecp/BoneCPConnectionProvider.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-provider-bone/src/main/java/org/apache/qpid/server/store/jdbc/bonecp/BoneCPConnectionProviderFactory.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java
    qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java
    qpid/trunk/qpid/java/broker-plugins/management-jmx/pom.xml
    qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java
    qpid/trunk/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java
    qpid/trunk/qpid/java/build.deps
    qpid/trunk/qpid/java/ivy.retrieve.xml
    qpid/trunk/qpid/java/module.xml
    qpid/trunk/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json
    qpid/trunk/qpid/java/pom.xml
    qpid/trunk/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
    qpid/trunk/qpid/java/systests/etc/config-systests.json
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AccessControlProviderRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BasicAuthRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BindingRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsClientCertAuthTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestHttpsTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/ExchangeRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesProviderRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/PreferencesRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QpidRestTestCase.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/QueueRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/RestTestHelper.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/SaslRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/StructureRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/UserPreferencesRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/VirtualHostRestTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/BrokerACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/ExchangeRestACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/GroupRestACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/LogViewerACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/QueueRestACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserPreferencesRestACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/acl/UserRestACLTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/client/timeouts/SyncWaitDelayTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/MaxDeliveryCountTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutDisabledTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/transacted/TransactionTimeoutTest.java
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java   (contents, props changed)
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/TestBrokerConfiguration.java
    qpid/trunk/qpid/java/systests/src/main/resources/META-INF/services/org.apache.qpid.server.plugin.MessageStoreFactory
    qpid/trunk/qpid/java/test-profiles/CPPExcludes   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/JavaTransientExcludes   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-bdb-spawn.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-bdb.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-mem.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-mem.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-mem.0-9-1.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-mem.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-dby-spawn.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-dby.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-dby.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-10.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-mms-spawn.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/java-mms.0-10.testprofile
    qpid/trunk/qpid/java/test-profiles/java-mms.0-8.testprofile
    qpid/trunk/qpid/java/test-profiles/java-mms.0-9-1.testprofile   (contents, props changed)
    qpid/trunk/qpid/java/test-profiles/java-mms.0-9.testprofile
    qpid/trunk/qpid/java/test-profiles/testprofile.defaults   (contents, props changed)
    qpid/trunk/qpid/packaging/windows/   (props changed)
    qpid/trunk/qpid/packaging/windows/installer.proj   (props changed)
    qpid/trunk/qpid/python/   (props changed)

Propchange: qpid/trunk/
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2:r1576683-1576696,1576698-1577099,1577101,1577103-1583556

Propchange: qpid/trunk/qpid/
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid:r1576683-1576696,1576698-1577099,1577101,1577103-1583556

Propchange: qpid/trunk/qpid/cpp/src/
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/cpp/src:r1576683-1583556

Propchange: qpid/trunk/qpid/cpp/src/CMakeLists.txt
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/cpp/src/CMakeLists.txt:r1576683-1583556

Propchange: qpid/trunk/qpid/cpp/src/tests/
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/cpp/src/tests:r1576683-1583556

Propchange: qpid/trunk/qpid/java/
------------------------------------------------------------------------------
  Merged /qpid/branches/java-broker-bdb-ha2/qpid/java:r1576683-1576696,1576698-1577099,1577101,1577103-1583556

Modified: qpid/trunk/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java (original)
+++ qpid/trunk/qpid/java/bdbstore/jmx/src/main/java/org/apache/qpid/server/store/berkeleydb/jmx/BDBHAMessageStoreManagerMBeanProvider.java Tue Apr  1 10:35:33 2014
@@ -28,6 +28,7 @@ import org.apache.qpid.server.jmx.MBeanP
 import org.apache.qpid.server.jmx.ManagedObject;
 import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.berkeleydb.BDBHAVirtualHostFactory;
 import org.apache.qpid.server.store.berkeleydb.BDBMessageStore;
 import org.apache.qpid.server.store.berkeleydb.replication.ReplicatedEnvironmentFacade;
 
@@ -48,8 +49,7 @@ public class BDBHAMessageStoreManagerMBe
     @Override
     public boolean isChildManageableByMBean(ConfiguredObject child)
     {
-        return (child instanceof VirtualHost
-            && ReplicatedEnvironmentFacade.TYPE.equals(child.getAttribute(VirtualHost.STORE_TYPE)));
+        return (child instanceof VirtualHost && BDBHAVirtualHostFactory.TYPE.equals(child.getType()));
     }
 
     @Override

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfiguredObjectRecord.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfiguredObjectRecord.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfiguredObjectRecord.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBConfiguredObjectRecord.java Tue Apr  1 10:35:33 2014
@@ -104,4 +104,11 @@ public class BDBConfiguredObjectRecord i
         result = 31 * result + (_type != null ? _type.hashCode() : 0);
         return result;
     }
+
+    @Override
+    public String toString()
+    {
+        return "BDBConfiguredObjectRecord [id=" + _id + ", type=" + _type + ", name=" + (_attributes == null ? null : _attributes.get("name")) + ", parents=" + _parents + "]";
+    }
+
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHost.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHost.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHost.java Tue Apr  1 10:35:33 2014
@@ -1,4 +1,3 @@
-package org.apache.qpid.server.store.berkeleydb;
 /*
  *
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -19,19 +18,20 @@ package org.apache.qpid.server.store.ber
  * under the License.
  *
  */
+package org.apache.qpid.server.store.berkeleydb;
+
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.log4j.Logger;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.connection.IConnectionRegistry;
+import org.apache.qpid.server.logging.messages.MessageStoreMessages;
 import org.apache.qpid.server.logging.subjects.MessageStoreLogSubject;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.stats.StatisticsGatherer;
 import org.apache.qpid.server.store.DurableConfigurationRecoverer;
 import org.apache.qpid.server.store.DurableConfigurationStore;
-import org.apache.qpid.server.store.Event;
-import org.apache.qpid.server.store.EventListener;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.OperationalLoggingListener;
 import org.apache.qpid.server.store.berkeleydb.replication.ReplicatedEnvironmentFacade;
 import org.apache.qpid.server.store.berkeleydb.replication.ReplicatedEnvironmentFacadeFactory;
 import org.apache.qpid.server.virtualhost.AbstractVirtualHost;
@@ -48,48 +48,31 @@ public class BDBHAVirtualHost extends Ab
     private static final Logger LOGGER = Logger.getLogger(BDBHAVirtualHost.class);
 
     private BDBMessageStore _messageStore;
-
-    private boolean _inVhostInitiatedClose;
+    private MessageStoreLogSubject _messageStoreLogSubject;
 
     BDBHAVirtualHost(VirtualHostRegistry virtualHostRegistry,
                      StatisticsGatherer brokerStatisticsGatherer,
                      org.apache.qpid.server.security.SecurityManager parentSecurityManager,
-                     VirtualHostConfiguration hostConfig,
                      VirtualHost virtualHost)
     {
-        super(virtualHostRegistry, brokerStatisticsGatherer, parentSecurityManager, hostConfig, virtualHost);
+        super(virtualHostRegistry, brokerStatisticsGatherer, parentSecurityManager, virtualHost);
     }
 
-    protected void initialiseStorage(VirtualHostConfiguration hostConfig, VirtualHost virtualHost)
+    protected void initialiseStorage(VirtualHost virtualHost)
     {
-        _messageStore = new BDBMessageStore(new ReplicatedEnvironmentFacadeFactory());
-
-        final MessageStoreLogSubject storeLogSubject =
-                new MessageStoreLogSubject(getName(), _messageStore.getClass().getSimpleName());
-        OperationalLoggingListener.listen(_messageStore, storeLogSubject, getEventLogger());
-
-        _messageStore.addEventListener(new BeforeActivationListener(), Event.BEFORE_ACTIVATE);
-        _messageStore.addEventListener(new AfterActivationListener(), Event.AFTER_ACTIVATE);
-        _messageStore.addEventListener(new BeforeCloseListener(), Event.BEFORE_CLOSE);
-
-
+        setState(State.PASSIVE);
 
-        _messageStore.addEventListener(new AfterInitialisationListener(), Event.AFTER_INIT);
-        _messageStore.addEventListener(new BeforePassivationListener(), Event.BEFORE_PASSIVATE);
+        _messageStoreLogSubject = new MessageStoreLogSubject(getName(), BDBMessageStore.class.getSimpleName());
+        _messageStore = new BDBMessageStore(new ReplicatedEnvironmentFacadeFactory());
+        getEventLogger().message(_messageStoreLogSubject, MessageStoreMessages.CREATED());
 
-        VirtualHostConfigRecoveryHandler recoveryHandler = new VirtualHostConfigRecoveryHandler(this);
-        DurableConfigurationRecoverer configRecoverer =
-                new DurableConfigurationRecoverer(getName(), getDurableConfigurationRecoverers(),
-                                                  new DefaultUpgraderProvider(this, getExchangeRegistry()), getEventLogger());
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>(virtualHost.getMessageStoreSettings());
+        messageStoreSettings.put(DurableConfigurationStore.IS_MESSAGE_STORE_TOO, true);
 
-        _messageStore.configureConfigStore(
-                virtualHost, configRecoverer
-        );
+        _messageStore.openConfigurationStore(virtualHost, messageStoreSettings);
+        _messageStore.openMessageStore(virtualHost, messageStoreSettings);
 
-        _messageStore.configureMessageStore(
-                virtualHost, recoveryHandler,
-                recoveryHandler
-        );
+        getEventLogger().message(_messageStoreLogSubject, MessageStoreMessages.STORE_LOCATION(_messageStore.getStoreLocation()));
 
         // Make the virtualhost model object a replication group listener
         ReplicatedEnvironmentFacade environmentFacade = (ReplicatedEnvironmentFacade) _messageStore.getEnvironmentFacade();
@@ -97,29 +80,6 @@ public class BDBHAVirtualHost extends Ab
 
     }
 
-
-    protected void closeStorage()
-    {
-        //Close MessageStore
-        if (_messageStore != null)
-        {
-            //Remove MessageStore Interface should not throw Exception
-            try
-            {
-                _inVhostInitiatedClose = true;
-                getMessageStore().close();
-            }
-            catch (Exception e)
-            {
-                getLogger().error("Failed to close message store", e);
-            }
-            finally
-            {
-                _inVhostInitiatedClose = false;
-            }
-        }
-    }
-
     @Override
     public DurableConfigurationStore getDurableConfigurationStore()
     {
@@ -132,77 +92,64 @@ public class BDBHAVirtualHost extends Ab
         return _messageStore;
     }
 
-    private final class AfterInitialisationListener implements EventListener
+    private void activate()
     {
-        public void event(Event event)
+        try
         {
-            setState(State.PASSIVE);
-        }
+            _messageStore.getEnvironmentFacade().getEnvironment().flushLog(true);
 
-    }
+            DefaultUpgraderProvider upgraderProvider = new DefaultUpgraderProvider(this);
 
-    private final class BeforePassivationListener implements EventListener
-    {
-        public void event(Event event)
-        {
-            State finalState = State.ERRORED;
+            DurableConfigurationRecoverer configRecoverer =
+                    new DurableConfigurationRecoverer(getName(), getDurableConfigurationRecoverers(),
+                            upgraderProvider, getEventLogger());
+            _messageStore.recoverConfigurationStore(configRecoverer);
 
-            try
-            {
-                    /* the approach here is not ideal as there is a race condition where a
-                     * queue etc could be created while the virtual host is on the way to
-                     * the passivated state.  However the store state change from MASTER to UNKNOWN
-                     * is documented as exceptionally rare..
-                     */
-
-                getConnectionRegistry().close(IConnectionRegistry.VHOST_PASSIVATE_REPLY_TEXT);
-                removeHouseKeepingTasks();
-
-                getQueueRegistry().stopAllAndUnregisterMBeans();
-                getExchangeRegistry().clearAndUnregisterMbeans();
-                getDtxRegistry().close();
-
-                finalState = State.PASSIVE;
-            }
-            finally
-            {
-                setState(finalState);
-                reportIfError(getState());
-            }
-        }
-
-    }
+            initialiseModel();
 
+            VirtualHostConfigRecoveryHandler recoveryHandler = new VirtualHostConfigRecoveryHandler(BDBHAVirtualHost.this, getMessageStoreLogSubject());
+            _messageStore.recoverMessageStore(recoveryHandler, recoveryHandler);
 
-    private final class BeforeActivationListener implements EventListener
-    {
-        @Override
-        public void event(Event event)
+            attainActivation();
+        }
+        catch (Exception e)
         {
-            initialiseModel(getConfiguration());
+            LOGGER.error("Failed to activate on hearing MASTER change event", e);
         }
     }
 
-    private final class AfterActivationListener implements EventListener
+    private void passivate()
     {
-        @Override
-        public void event(Event event)
+        State finalState = State.ERRORED;
+
+        try
         {
-            attainActivation();
+            /* the approach here is not ideal as there is a race condition where a
+             * queue etc could be created while the virtual host is on the way to
+             * the passivated state.  However the store state change from MASTER to UNKNOWN
+             * is documented as exceptionally rare.
+             */
+
+            getConnectionRegistry().close(IConnectionRegistry.VHOST_PASSIVATE_REPLY_TEXT);
+            removeHouseKeepingTasks();
+
+            getQueueRegistry().stopAllAndUnregisterMBeans();
+            getExchangeRegistry().clearAndUnregisterMbeans();
+            getDtxRegistry().close();
+
+            finalState = State.PASSIVE;
+        }
+        finally
+        {
+            setState(finalState);
+            reportIfError(getState());
         }
     }
 
-    private final class BeforeCloseListener implements EventListener
+    @Override
+    protected MessageStoreLogSubject getMessageStoreLogSubject()
     {
-        @Override
-        public void event(Event event)
-        {
-            if(!_inVhostInitiatedClose)
-            {
-                shutdownHouseKeeping();
-            }
-
-        }
+        return _messageStoreLogSubject;
     }
 
     private class BDBHAMessageStoreStateChangeListener implements StateChangeListener
@@ -215,8 +162,7 @@ public class BDBHAVirtualHost extends Ab
 
             if (LOGGER.isInfoEnabled())
             {
-                LOGGER.info("Received BDB event indicating transition to state " + state
-                        + " when current message store state is " + _messageStore._stateManager.getState());
+                LOGGER.info("Received BDB event indicating transition to state " + state);
             }
 
             switch (state)
@@ -239,36 +185,6 @@ public class BDBHAVirtualHost extends Ab
                 throw new IllegalStateException("Unexpected state change: " + state);
             }
         }
-
-        private void activate()
-        {
-            try
-            {
-                _messageStore.getEnvironmentFacade().getEnvironment().flushLog(true);
-                _messageStore.activate();
-            }
-            catch (Exception e)
-            {
-                LOGGER.error("Failed to activate on hearing MASTER change event", e);
-            }
-        }
-
-        private void passivate()
-        {
-            try
-            {
-                //TODO: move this this into the store method passivate()
-                if (_messageStore._stateManager.isNotInState(org.apache.qpid.server.store.State.INITIALISED))
-                {
-                    _messageStore._stateManager.attainState(org.apache.qpid.server.store.State.INITIALISED);
-                }
-            }
-            catch (Exception e)
-            {
-                LOGGER.error("Failed to passivate on hearing REPLICA or DETACHED change event", e);
-            }
-        }
-
     }
 
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostFactory.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBHAVirtualHostFactory.java Tue Apr  1 10:35:33 2014
@@ -19,16 +19,12 @@ package org.apache.qpid.server.store.ber
  *
  */
 
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
 import java.util.Map;
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
-import org.apache.qpid.server.model.adapter.VirtualHostAdapter;
+
 import org.apache.qpid.server.plugin.VirtualHostFactory;
 import org.apache.qpid.server.stats.StatisticsGatherer;
-import org.apache.qpid.server.store.MessageStoreConstants;
+import org.apache.qpid.server.store.MessageStore;
+import org.apache.qpid.server.store.berkeleydb.replication.ReplicatedEnvironmentFacadeFactory;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
@@ -47,24 +43,29 @@ public class BDBHAVirtualHostFactory imp
     public VirtualHost createVirtualHost(VirtualHostRegistry virtualHostRegistry,
                                          StatisticsGatherer brokerStatisticsGatherer,
                                          org.apache.qpid.server.security.SecurityManager parentSecurityManager,
-                                         VirtualHostConfiguration hostConfig,
                                          org.apache.qpid.server.model.VirtualHost virtualHost)
     {
         return new BDBHAVirtualHost(virtualHostRegistry,
                                     brokerStatisticsGatherer,
                                     parentSecurityManager,
-                                    hostConfig,
                                     virtualHost);
     }
 
     @Override
     public void validateAttributes(Map<String, Object> attributes)
     {
-        validateAttribute(org.apache.qpid.server.model.VirtualHost.STORE_PATH, String.class, attributes);
-        validateAttribute("haGroupName", String.class, attributes);
-        validateAttribute("haNodeName", String.class, attributes);
-        validateAttribute("haNodeAddress", String.class, attributes);
-        validateAttribute("haHelperAddress", String.class, attributes);
+        @SuppressWarnings("unchecked")
+        Map<String, Object> messageStoreSettings = (Map<String, Object>)attributes.get(org.apache.qpid.server.model.VirtualHost.MESSAGE_STORE_SETTINGS);
+        if (messageStoreSettings == null)
+        {
+            throw new IllegalArgumentException("Attribute '"+ org.apache.qpid.server.model.VirtualHost.MESSAGE_STORE_SETTINGS + "' is required.");
+        }
+
+        validateAttribute(MessageStore.STORE_PATH, String.class, messageStoreSettings);
+        validateAttribute(ReplicatedEnvironmentFacadeFactory.GROUP_NAME, String.class, messageStoreSettings);
+        validateAttribute(ReplicatedEnvironmentFacadeFactory.NODE_NAME, String.class, messageStoreSettings);
+        validateAttribute(ReplicatedEnvironmentFacadeFactory.NODE_ADDRESS, String.class, messageStoreSettings);
+        validateAttribute(ReplicatedEnvironmentFacadeFactory.HELPER_ADDRESS, String.class, messageStoreSettings);
     }
 
     private void validateAttribute(String attrName, Class<?> clazz, Map<String, Object> attributes)
@@ -77,82 +78,4 @@ public class BDBHAVirtualHostFactory imp
         }
     }
 
-    @Override
-    public Map<String, Object> createVirtualHostConfiguration(VirtualHostAdapter virtualHostAdapter)
-    {
-        LinkedHashMap<String,Object> convertedMap = new LinkedHashMap<String, Object>();
-        convertedMap.put("store.environment-path", virtualHostAdapter.getAttribute(org.apache.qpid.server.model.VirtualHost.STORE_PATH));
-
-        return convertedMap;
-    }
-
-    public Map<String, Object> convertVirtualHostConfiguration(Configuration configuration)
-    {
-
-        LinkedHashMap<String,Object> convertedMap = new LinkedHashMap<String, Object>();
-
-        Configuration storeConfiguration = configuration.subset("store");
-
-        convertedMap.put(org.apache.qpid.server.model.VirtualHost.STORE_PATH, storeConfiguration.getString(MessageStoreConstants.ENVIRONMENT_PATH_PROPERTY));
-        convertedMap.put(MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE, storeConfiguration.getString(MessageStoreConstants.OVERFULL_SIZE_PROPERTY));
-        convertedMap.put(MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE, storeConfiguration.getString(MessageStoreConstants.UNDERFULL_SIZE_PROPERTY));
-        convertedMap.put("haGroupName", configuration.getString("store.highAvailability.groupName"));
-        convertedMap.put("haNodeName", configuration.getString("store.highAvailability.nodeName"));
-        convertedMap.put("haNodeAddress", configuration.getString("store.highAvailability.nodeHostPort"));
-        convertedMap.put("haHelperAddress", configuration.getString("store.highAvailability.helperHostPort"));
-
-        final Object haDurability = configuration.getString("store.highAvailability.durability");
-        if(haDurability !=null)
-        {
-            convertedMap.put("haDurability", haDurability);
-        }
-
-        final Object designatedPrimary = configuration.getString("store.highAvailability.designatedPrimary");
-        if(designatedPrimary!=null)
-        {
-            convertedMap.put("haDesignatedPrimary", designatedPrimary);
-        }
-
-        final Object coalescingSync = configuration.getString("store.highAvailability.coalescingSync");
-        if(coalescingSync!=null)
-        {
-            convertedMap.put("haCoalescingSync", coalescingSync);
-        }
-
-
-        Map<String, String> attributes = getEnvironmentMap(storeConfiguration, "envConfig");
-
-        if(!attributes.isEmpty())
-        {
-            convertedMap.put("bdbEnvironmentConfig",attributes);
-        }
-
-        attributes = getEnvironmentMap(storeConfiguration, "repConfig");
-
-        if(!attributes.isEmpty())
-        {
-            convertedMap.put("haReplicationConfig",attributes);
-        }
-
-        return convertedMap;
-
-    }
-
-    private Map<String, String> getEnvironmentMap(Configuration storeConfiguration, String configName)
-    {
-        final List<Object> argumentNames = storeConfiguration.getList(configName +".name");
-        final List<Object> argumentValues = storeConfiguration.getList(configName +".value");
-        final int initialSize = argumentNames.size();
-
-        final Map<String,String> attributes = new HashMap<String,String>(initialSize);
-
-        for (int i = 0; i < argumentNames.size(); i++)
-        {
-            final String argName = argumentNames.get(i).toString();
-            final String argValue = argumentValues.get(i).toString();
-
-            attributes.put(argName, argValue);
-        }
-        return attributes;
-    }
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStore.java Tue Apr  1 10:35:33 2014
@@ -37,7 +37,7 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.server.message.EnqueueableMessage;
-import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.ConfiguredObject;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.store.ConfigurationRecoveryHandler;
 import org.apache.qpid.server.store.ConfiguredObjectRecord;
@@ -46,11 +46,8 @@ import org.apache.qpid.server.store.Even
 import org.apache.qpid.server.store.EventListener;
 import org.apache.qpid.server.store.EventManager;
 import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.MessageStoreConstants;
 import org.apache.qpid.server.store.MessageStoreRecoveryHandler;
 import org.apache.qpid.server.store.MessageStoreRecoveryHandler.StoredMessageRecoveryHandler;
-import org.apache.qpid.server.store.State;
-import org.apache.qpid.server.store.StateManager;
 import org.apache.qpid.server.store.StorableMessageMetaData;
 import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.server.store.StoreFuture;
@@ -59,6 +56,7 @@ import org.apache.qpid.server.store.Stor
 import org.apache.qpid.server.store.TransactionLogRecoveryHandler;
 import org.apache.qpid.server.store.TransactionLogRecoveryHandler.QueueEntryRecoveryHandler;
 import org.apache.qpid.server.store.TransactionLogResource;
+import org.apache.qpid.server.store.berkeleydb.EnvironmentFacadeFactory.EnvironmentFacadeTask;
 import org.apache.qpid.server.store.berkeleydb.entry.HierarchyKey;
 import org.apache.qpid.server.store.berkeleydb.entry.PreparedTransaction;
 import org.apache.qpid.server.store.berkeleydb.entry.QueueEntryKey;
@@ -72,6 +70,7 @@ import org.apache.qpid.server.store.berk
 import org.apache.qpid.server.store.berkeleydb.tuple.UUIDTupleBinding;
 import org.apache.qpid.server.store.berkeleydb.tuple.XidBinding;
 import org.apache.qpid.server.store.berkeleydb.upgrade.Upgrader;
+import org.apache.qpid.server.util.MapValueConverter;
 import org.apache.qpid.util.FileUtils;
 
 import com.sleepycat.bind.tuple.ByteBinding;
@@ -102,7 +101,6 @@ public class BDBMessageStore implements 
     private static final Logger LOGGER = Logger.getLogger(BDBMessageStore.class);
 
     public static final int VERSION = 8;
-    public static final String ENVIRONMENT_CONFIGURATION = "bdbEnvironmentConfig";
     private static final int LOCK_RETRY_ATTEMPTS = 5;
     private static String CONFIGURED_OBJECTS_DB_NAME = "CONFIGURED_OBJECTS";
     private static String CONFIGURED_OBJECT_HIERARCHY_DB_NAME = "CONFIGURED_OBJECT_HIERARCHY";
@@ -110,25 +108,20 @@ public class BDBMessageStore implements 
     private static String MESSAGE_META_DATA_DB_NAME = "MESSAGE_METADATA";
     private static String MESSAGE_CONTENT_DB_NAME = "MESSAGE_CONTENT";
     private static String DELIVERY_DB_NAME = "QUEUE_ENTRIES";
+
+    //TODO: Add upgrader to remove BRIDGES and LINKS
     private static String BRIDGEDB_NAME = "BRIDGES";
     private static String LINKDB_NAME = "LINKS";
     private static String XID_DB_NAME = "XIDS";
     private static String CONFIG_VERSION_DB_NAME = "CONFIG_VERSION";
-    private static final String[] DATABASE_NAMES = new String[] { CONFIGURED_OBJECTS_DB_NAME, CONFIGURED_OBJECT_HIERARCHY_DB_NAME, MESSAGE_META_DATA_DB_NAME,
-            MESSAGE_CONTENT_DB_NAME, DELIVERY_DB_NAME, BRIDGEDB_NAME, LINKDB_NAME, XID_DB_NAME, CONFIG_VERSION_DB_NAME };
-
-    private final AtomicBoolean _closed = new AtomicBoolean(false);
+    private static final String[] CONFIGURATION_STORE_DATABASE_NAMES = new String[] { CONFIGURED_OBJECTS_DB_NAME, CONFIG_VERSION_DB_NAME , CONFIGURED_OBJECT_HIERARCHY_DB_NAME};
+    private static final String[] MESSAGE_STORE_DATABASE_NAMES = new String[] { MESSAGE_META_DATA_DB_NAME, MESSAGE_CONTENT_DB_NAME, DELIVERY_DB_NAME, BRIDGEDB_NAME, LINKDB_NAME, XID_DB_NAME };
 
     private EnvironmentFacade _environmentFacade;
     private final AtomicLong _messageId = new AtomicLong(0);
 
-    protected final StateManager _stateManager;
-
-    private MessageStoreRecoveryHandler _messageRecoveryHandler;
-
-    private TransactionLogRecoveryHandler _tlogRecoveryHandler;
-
-    private ConfigurationRecoveryHandler _configRecoveryHandler;
+    private final AtomicBoolean _messageStoreOpen = new AtomicBoolean();
+    private final AtomicBoolean _configurationStoreOpen = new AtomicBoolean();
 
     private long _totalStoreSize;
     private boolean _limitBusted;
@@ -137,12 +130,12 @@ public class BDBMessageStore implements 
 
     private final EventManager _eventManager = new EventManager();
     private final String _type;
-    private VirtualHost _virtualHost;
 
     private final EnvironmentFacadeFactory _environmentFacadeFactory;
 
     private volatile Committer _committer;
 
+
     public BDBMessageStore()
     {
         this(new StandardEnvironmentFacadeFactory());
@@ -152,7 +145,6 @@ public class BDBMessageStore implements 
     {
         _type = environmentFacadeFactory.getType();
         _environmentFacadeFactory = environmentFacadeFactory;
-        _stateManager = new StateManager(_eventManager);
     }
 
     @Override
@@ -162,110 +154,91 @@ public class BDBMessageStore implements 
     }
 
     @Override
-    public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
+    public void openConfigurationStore(ConfiguredObject<?> parent, Map<String, Object> storeSettings)
     {
-        _stateManager.attainState(State.INITIALISING);
-
-        _configRecoveryHandler = recoveryHandler;
-        _virtualHost = virtualHost;
+        if (_configurationStoreOpen.compareAndSet(false,  true))
+        {
+            if (_environmentFacade == null)
+            {
+                String[] databaseNames = null;
+                if (MapValueConverter.getBooleanAttribute(IS_MESSAGE_STORE_TOO, storeSettings, false))
+                {
+                    databaseNames = new String[CONFIGURATION_STORE_DATABASE_NAMES.length + MESSAGE_STORE_DATABASE_NAMES.length];
+                    System.arraycopy(CONFIGURATION_STORE_DATABASE_NAMES, 0, databaseNames, 0, CONFIGURATION_STORE_DATABASE_NAMES.length);
+                    System.arraycopy(MESSAGE_STORE_DATABASE_NAMES, 0, databaseNames, CONFIGURATION_STORE_DATABASE_NAMES.length, MESSAGE_STORE_DATABASE_NAMES.length);
+                }
+                else
+                {
+                    databaseNames = CONFIGURATION_STORE_DATABASE_NAMES;
+                }
+                _environmentFacade = _environmentFacadeFactory.createEnvironmentFacade(storeSettings, new UpgradeTask(parent), new OpenDatabasesTask(databaseNames));
+            }
+            else
+            {
+                throw new IllegalStateException("The database have been already opened as message store");
+            }
+        }
     }
 
     @Override
-    public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler messageRecoveryHandler,
-                                      TransactionLogRecoveryHandler tlogRecoveryHandler) throws StoreException
+    public void recoverConfigurationStore(ConfigurationRecoveryHandler recoveryHandler)
     {
-        if(_stateManager.isInState(State.INITIAL))
-        {
-            // Is acting as a message store, but not a durable config store
-            _stateManager.attainState(State.INITIALISING);
-        }
+        checkConfigurationStoreOpen();
 
-        _messageRecoveryHandler = messageRecoveryHandler;
-        _tlogRecoveryHandler = tlogRecoveryHandler;
-        _virtualHost = virtualHost;
 
-        completeInitialisation();
+        recoverConfig(recoveryHandler);
     }
 
-    private void completeInitialisation() throws StoreException
+    @Override
+    public void openMessageStore(ConfiguredObject<?> parent, Map<String, Object> messageStoreSettings) throws StoreException
     {
-        configure(_virtualHost, _messageRecoveryHandler != null);
+        if (_messageStoreOpen.compareAndSet(false, true))
+        {
 
-        _stateManager.attainState(State.INITIALISED);
-    }
+            Object overfullAttr = messageStoreSettings.get(MessageStore.OVERFULL_SIZE);
+            Object underfullAttr = messageStoreSettings.get(MessageStore.UNDERFULL_SIZE);
 
-    private void startActivation() throws StoreException
-    {
-        DatabaseConfig dbConfig = new DatabaseConfig();
-        dbConfig.setTransactional(true);
-        dbConfig.setAllowCreate(true);
-        try
-        {
-            new Upgrader(_environmentFacade.getEnvironment(), _virtualHost).upgradeIfNecessary();
-            _environmentFacade.openDatabases(dbConfig, DATABASE_NAMES);
-            _totalStoreSize = getSizeOnDisk();
-        }
-        catch(DatabaseException e)
-        {
-            throw _environmentFacade.handleDatabaseException("Cannot configure store", e);
-        }
+            _persistentSizeHighThreshold = overfullAttr == null ? -1l :
+                                           overfullAttr instanceof Number ? ((Number) overfullAttr).longValue() : Long.parseLong(overfullAttr.toString());
+            _persistentSizeLowThreshold = underfullAttr == null ? _persistentSizeHighThreshold :
+                                           underfullAttr instanceof Number ? ((Number) underfullAttr).longValue() : Long.parseLong(underfullAttr.toString());
+
+            if(_persistentSizeLowThreshold > _persistentSizeHighThreshold || _persistentSizeLowThreshold < 0l)
+            {
+                _persistentSizeLowThreshold = _persistentSizeHighThreshold;
+            }
+
+            if (_environmentFacade == null)
+            {
+                _environmentFacade = _environmentFacadeFactory.createEnvironmentFacade(messageStoreSettings, new UpgradeTask(parent), new OpenDatabasesTask(MESSAGE_STORE_DATABASE_NAMES), new DiskSpaceTask());
+            }
 
+            _committer = _environmentFacade.createCommitter(parent.getName());
+            _committer.start();
+        }
     }
 
     @Override
-    public synchronized void activate() throws StoreException
+    public synchronized void recoverMessageStore(MessageStoreRecoveryHandler messageRecoveryHandler, TransactionLogRecoveryHandler transactionLogRecoveryHandler) throws StoreException
     {
-        // check if acting as a durable config store, but not a message store
-        if(_stateManager.isInState(State.INITIALISING))
-        {
-            completeInitialisation();
-        }
-
-        _stateManager.attainState(State.ACTIVATING);
-        startActivation();
+        checkMessageStoreOpen();
 
-        if(_configRecoveryHandler != null)
+        if(messageRecoveryHandler != null)
         {
-            recoverConfig(_configRecoveryHandler);
+            recoverMessages(messageRecoveryHandler);
         }
-        if(_messageRecoveryHandler != null)
+        if(transactionLogRecoveryHandler != null)
         {
-            recoverMessages(_messageRecoveryHandler);
+            recoverQueueEntries(transactionLogRecoveryHandler);
         }
-        if(_tlogRecoveryHandler != null)
-        {
-            recoverQueueEntries(_tlogRecoveryHandler);
-        }
-
-        _stateManager.attainState(State.ACTIVE);
     }
 
     @Override
     public org.apache.qpid.server.store.Transaction newTransaction() throws StoreException
     {
-        return new BDBTransaction();
-    }
-
-    private void configure(VirtualHost virtualHost, boolean isMessageStore) throws StoreException
-    {
-        Object overfullAttr = virtualHost.getAttribute(MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE);
-        Object underfullAttr = virtualHost.getAttribute(MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE);
-
-        _persistentSizeHighThreshold = overfullAttr == null ? -1l :
-                                       overfullAttr instanceof Number ? ((Number) overfullAttr).longValue() : Long.parseLong(overfullAttr.toString());
-        _persistentSizeLowThreshold = underfullAttr == null ? _persistentSizeHighThreshold :
-                                       underfullAttr instanceof Number ? ((Number) underfullAttr).longValue() : Long.parseLong(underfullAttr.toString());
-
+        checkMessageStoreOpen();
 
-        if(_persistentSizeLowThreshold > _persistentSizeHighThreshold || _persistentSizeLowThreshold < 0l)
-        {
-            _persistentSizeLowThreshold = _persistentSizeHighThreshold;
-        }
-
-        _environmentFacade = _environmentFacadeFactory.createEnvironmentFacade(virtualHost, isMessageStore);
-
-        _committer = _environmentFacade.createCommitter(virtualHost.getName());
-        _committer.start();
+        return new BDBTransaction();
     }
 
     @Override
@@ -283,33 +256,47 @@ public class BDBMessageStore implements 
         return _environmentFacade;
     }
 
-    /**
-     * Called to close and cleanup any resources used by the message store.
-     *
-     * @throws Exception If the close fails.
-     */
     @Override
-    public void close() throws StoreException
+    public void closeMessageStore() throws StoreException
     {
-        if (_closed.compareAndSet(false, true))
+        if (_messageStoreOpen.compareAndSet(true, false))
         {
-            _stateManager.attainState(State.CLOSING);
             try
             {
-                try
+                if (_committer != null)
                 {
                     _committer.stop();
                 }
-                finally
+            }
+            finally
+            {
+                if (!_configurationStoreOpen.get())
                 {
                     closeEnvironment();
                 }
             }
-            catch(DatabaseException e)
+        }
+    }
+
+    @Override
+    public void closeConfigurationStore() throws StoreException
+    {
+        if (_configurationStoreOpen.compareAndSet(true, false))
+        {
+            try
             {
-                throw new StoreException("Exception occured on message store close", e);
+                if (_committer != null)
+                {
+                    _committer.stop();
+                }
+            }
+            finally
+            {
+                if (!_messageStoreOpen.get())
+                {
+                    closeEnvironment();
+                }
             }
-            _stateManager.attainState(State.CLOSED);
         }
     }
 
@@ -751,27 +738,25 @@ public class BDBMessageStore implements 
     @Override
     public void create(ConfiguredObjectRecord configuredObject) throws StoreException
     {
-        if (_stateManager.isInState(State.ACTIVE))
+        checkConfigurationStoreOpen();
+        com.sleepycat.je.Transaction txn = null;
+        try
         {
-            com.sleepycat.je.Transaction txn = null;
-            try
-            {
-                txn = _environmentFacade.getEnvironment().beginTransaction(null, null);
-                storeConfiguredObjectEntry(txn, configuredObject);
-                txn.commit();
-                txn = null;
-            }
-            catch (DatabaseException e)
-            {
-                throw _environmentFacade.handleDatabaseException("Error creating configured object " + configuredObject
-                        + " in database: " + e.getMessage(), e);
-            }
-            finally
+            txn = _environmentFacade.getEnvironment().beginTransaction(null, null);
+            storeConfiguredObjectEntry(txn, configuredObject);
+            txn.commit();
+            txn = null;
+        }
+        catch (DatabaseException e)
+        {
+            throw _environmentFacade.handleDatabaseException("Error creating configured object " + configuredObject
+                    + " in database: " + e.getMessage(), e);
+        }
+        finally
+        {
+            if (txn != null)
             {
-                if (txn != null)
-                {
-                    abortTransactionIgnoringException("Error creating configured object", txn);
-                }
+                abortTransactionIgnoringException("Error creating configured object", txn);
             }
         }
     }
@@ -779,11 +764,13 @@ public class BDBMessageStore implements 
     @Override
     public UUID[] remove(final ConfiguredObjectRecord... objects) throws StoreException
     {
+        checkConfigurationStoreOpen();
+
         com.sleepycat.je.Transaction txn = null;
         try
         {
             txn = _environmentFacade.getEnvironment().beginTransaction(null, null);
-            
+
             Collection<UUID> removed = new ArrayList<UUID>(objects.length);
             for(ConfiguredObjectRecord record : objects)
             {
@@ -792,7 +779,7 @@ public class BDBMessageStore implements 
                     removed.add(record.getId());
                 }
             }
-            
+
             txn.commit();
             txn = null;
             return removed.toArray(new UUID[removed.size()]);
@@ -814,6 +801,8 @@ public class BDBMessageStore implements 
     @Override
     public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
     {
+        checkConfigurationStoreOpen();
+
         com.sleepycat.je.Transaction txn = null;
         try
         {
@@ -885,7 +874,7 @@ public class BDBMessageStore implements 
      *
      * @throws StoreException If the operation fails for any reason.
      */
-    public void enqueueMessage(final com.sleepycat.je.Transaction tx, final TransactionLogResource queue,
+    private void enqueueMessage(final com.sleepycat.je.Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
     {
 
@@ -924,7 +913,7 @@ public class BDBMessageStore implements 
      *
      * @throws StoreException If the operation fails for any reason, or if the specified message does not exist.
      */
-    public void dequeueMessage(final com.sleepycat.je.Transaction tx, final TransactionLogResource queue,
+    private void dequeueMessage(final com.sleepycat.je.Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
     {
 
@@ -1341,38 +1330,35 @@ public class BDBMessageStore implements 
 
     private void storeConfiguredObjectEntry(final Transaction txn, ConfiguredObjectRecord configuredObject) throws StoreException
     {
-        if (_stateManager.isInState(State.ACTIVE))
+        if (LOGGER.isDebugEnabled())
         {
-            if (LOGGER.isDebugEnabled())
-            {
-                LOGGER.debug("Storing configured object: " + configuredObject);
-            }
-            DatabaseEntry key = new DatabaseEntry();
-            UUIDTupleBinding uuidBinding = UUIDTupleBinding.getInstance();
-            uuidBinding.objectToEntry(configuredObject.getId(), key);
+            LOGGER.debug("Storing configured object record: " + configuredObject);
+        }
+        DatabaseEntry key = new DatabaseEntry();
+        UUIDTupleBinding uuidBinding = UUIDTupleBinding.getInstance();
+        uuidBinding.objectToEntry(configuredObject.getId(), key);
 
-            DatabaseEntry value = new DatabaseEntry();
-            ConfiguredObjectBinding queueBinding = ConfiguredObjectBinding.getInstance();
+        DatabaseEntry value = new DatabaseEntry();
+        ConfiguredObjectBinding queueBinding = ConfiguredObjectBinding.getInstance();
 
-            queueBinding.objectToEntry(configuredObject, value);
-            try
-            {
-                OperationStatus status = getConfiguredObjectsDb().put(txn, key, value);
-                if (status != OperationStatus.SUCCESS)
-                {
-                    throw new StoreException("Error writing configured object " + configuredObject + " to database: "
-                            + status);
-                }
-                writeHierarchyRecords(txn, configuredObject);               
-            }
-            catch (DatabaseException e)
+        queueBinding.objectToEntry(configuredObject, value);
+        try
+        {
+            OperationStatus status = getConfiguredObjectsDb().put(txn, key, value);
+            if (status != OperationStatus.SUCCESS)
             {
-                throw _environmentFacade.handleDatabaseException("Error writing configured object " + configuredObject
-                        + " to database: " + e.getMessage(), e);
+                throw new StoreException("Error writing configured object " + configuredObject + " to database: "
+                        + status);
             }
+            writeHierarchyRecords(txn, configuredObject);
+        }
+        catch (DatabaseException e)
+        {
+            throw _environmentFacade.handleDatabaseException("Error writing configured object " + configuredObject
+                    + " to database: " + e.getMessage(), e);
         }
     }
-    
+
     private void writeHierarchyRecords(final Transaction txn, final ConfiguredObjectRecord configuredObject)
     {
         OperationStatus status;
@@ -1398,7 +1384,7 @@ public class BDBMessageStore implements 
     {
         UUID id = record.getId();
         Map<String, ConfiguredObjectRecord> parents = record.getParents();
- 
+
         if (LOGGER.isDebugEnabled())
         {
             LOGGER.debug("Removing configured object: " + id);
@@ -1449,11 +1435,14 @@ public class BDBMessageStore implements 
             _metaDataRef = new SoftReference<StorableMessageMetaData>(metaData);
         }
 
+        @Override
         public StorableMessageMetaData getMetaData()
         {
             StorableMessageMetaData metaData = _metaDataRef.get();
             if(metaData == null)
             {
+                checkMessageStoreOpen();
+
                 metaData = BDBMessageStore.this.getMessageMetaData(_messageId);
                 _metaDataRef = new SoftReference<StorableMessageMetaData>(metaData);
             }
@@ -1461,11 +1450,13 @@ public class BDBMessageStore implements 
             return metaData;
         }
 
+        @Override
         public long getMessageNumber()
         {
             return _messageId;
         }
 
+        @Override
         public void addContent(int offsetInMessage, java.nio.ByteBuffer src)
         {
             src = src.slice();
@@ -1488,6 +1479,7 @@ public class BDBMessageStore implements 
 
         }
 
+        @Override
         public int getContent(int offsetInMessage, java.nio.ByteBuffer dst)
         {
             byte[] data = _dataRef == null ? null : _dataRef.get();
@@ -1499,10 +1491,13 @@ public class BDBMessageStore implements 
             }
             else
             {
+                checkMessageStoreOpen();
+
                 return BDBMessageStore.this.getContent(_messageId, offsetInMessage, dst);
             }
         }
 
+        @Override
         public ByteBuffer getContent(int offsetInMessage, int size)
         {
             byte[] data = _dataRef == null ? null : _dataRef.get();
@@ -1539,10 +1534,13 @@ public class BDBMessageStore implements 
             }
         }
 
+        @Override
         public synchronized StoreFuture flushToStore()
         {
             if(!stored())
             {
+                checkMessageStoreOpen();
+
                 com.sleepycat.je.Transaction txn;
                 try
                 {
@@ -1562,8 +1560,11 @@ public class BDBMessageStore implements 
             return StoreFuture.IMMEDIATE_FUTURE;
         }
 
+        @Override
         public void remove()
         {
+            checkMessageStoreOpen();
+
             int delta = getMetaData().getContentSize();
             BDBMessageStore.this.removeMessage(_messageId, false);
             storedSizeChangeOccured(-delta);
@@ -1592,8 +1593,11 @@ public class BDBMessageStore implements 
             }
         }
 
+        @Override
         public void enqueueMessage(TransactionLogResource queue, EnqueueableMessage message) throws StoreException
         {
+            checkMessageStoreOpen();
+
             if(message.getStoredMessage() instanceof StoredBDBMessage)
             {
                 final StoredBDBMessage storedMessage = (StoredBDBMessage) message.getStoredMessage();
@@ -1604,36 +1608,54 @@ public class BDBMessageStore implements 
             BDBMessageStore.this.enqueueMessage(_txn, queue, message.getMessageNumber());
         }
 
+        @Override
         public void dequeueMessage(TransactionLogResource queue, EnqueueableMessage message) throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.dequeueMessage(_txn, queue, message.getMessageNumber());
         }
 
+        @Override
         public void commitTran() throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.commitTranImpl(_txn, true);
             BDBMessageStore.this.storedSizeChangeOccured(_storeSizeIncrease);
         }
 
+        @Override
         public StoreFuture commitTranAsync() throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.storedSizeChangeOccured(_storeSizeIncrease);
             return BDBMessageStore.this.commitTranImpl(_txn, false);
         }
 
+        @Override
         public void abortTran() throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.abortTran(_txn);
         }
 
+        @Override
         public void removeXid(long format, byte[] globalId, byte[] branchId) throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.removeXid(_txn, format, globalId, branchId);
         }
 
+        @Override
         public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues,
                               Record[] dequeues) throws StoreException
         {
+            checkMessageStoreOpen();
+
             BDBMessageStore.this.recordXid(_txn, format, globalId, branchId, enqueues, dequeues);
         }
     }
@@ -1697,6 +1719,22 @@ public class BDBMessageStore implements 
         }
     }
 
+    private void checkConfigurationStoreOpen()
+    {
+        if (!_configurationStoreOpen.get())
+        {
+            throw new IllegalStateException("Configuration store is not open");
+        }
+    }
+
+    private void checkMessageStoreOpen()
+    {
+        if (!_messageStoreOpen.get())
+        {
+            throw new IllegalStateException("Message store is not open");
+        }
+    }
+
     private void reduceSizeOnDisk()
     {
         _environmentFacade.getEnvironment().getConfig().setConfigParam(EnvironmentConfig.ENV_RUN_CLEANER, "false");
@@ -1796,4 +1834,72 @@ public class BDBMessageStore implements 
         return _environmentFacade.getOpenDatabase(XID_DB_NAME);
     }
 
+    class UpgradeTask implements EnvironmentFacadeTask
+    {
+
+        private ConfiguredObject<?> _parent;
+
+        public UpgradeTask(ConfiguredObject<?> parent)
+        {
+            _parent = parent;
+        }
+
+        @Override
+        public void execute(EnvironmentFacade facade)
+        {
+            try
+            {
+                new Upgrader(facade.getEnvironment(), _parent).upgradeIfNecessary();
+            }
+            catch(DatabaseException e)
+            {
+                throw facade.handleDatabaseException("Cannot upgrade store", e);
+            }
+        }
+    }
+
+    class OpenDatabasesTask implements EnvironmentFacadeTask
+    {
+        private String[] _names;
+
+        public OpenDatabasesTask(String[] names)
+        {
+            _names = names;
+        }
+
+        @Override
+        public void execute(EnvironmentFacade facade)
+        {
+            try
+            {
+                DatabaseConfig dbConfig = new DatabaseConfig();
+                dbConfig.setTransactional(true);
+                dbConfig.setAllowCreate(true);
+                facade.openDatabases(dbConfig, _names);
+            }
+            catch(DatabaseException e)
+            {
+                throw facade.handleDatabaseException("Cannot open databases", e);
+            }
+        }
+
+    }
+
+    class DiskSpaceTask implements EnvironmentFacadeTask
+    {
+
+        @Override
+        public void execute(EnvironmentFacade facade)
+        {
+            try
+            {
+                _totalStoreSize = facade.getEnvironment().getStats(null).getTotalLogSize();
+            }
+            catch(DatabaseException e)
+            {
+                throw facade.handleDatabaseException("Cannot evaluate disk store size", e);
+            }
+        }
+
+    }
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/BDBMessageStoreFactory.java Tue Apr  1 10:35:33 2014
@@ -20,12 +20,8 @@
  */
 package org.apache.qpid.server.store.berkeleydb;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.configuration.Configuration;
 import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.plugin.DurableConfigurationStoreFactory;
 import org.apache.qpid.server.plugin.MessageStoreFactory;
@@ -54,53 +50,29 @@ public class BDBMessageStoreFactory impl
     }
 
     @Override
-    public Map<String, Object> convertStoreConfiguration(Configuration storeConfiguration)
-    {
-        final List<Object> argumentNames = storeConfiguration.getList("envConfig.name");
-        final List<Object> argumentValues = storeConfiguration.getList("envConfig.value");
-        final int initialSize = argumentNames.size();
-
-        final Map<String,String> attributes = new HashMap<String,String>(initialSize);
-
-        for (int i = 0; i < argumentNames.size(); i++)
-        {
-            final String argName = argumentNames.get(i).toString();
-            final String argValue = argumentValues.get(i).toString();
-
-            attributes.put(argName, argValue);
-        }
-
-        if(initialSize != 0)
-        {
-            return Collections.singletonMap(BDBMessageStore.ENVIRONMENT_CONFIGURATION, (Object)attributes);
-        }
-        else
-        {
-            return Collections.emptyMap();
-        }
-
-
-    }
-
-    @Override
     public void validateAttributes(Map<String, Object> attributes)
     {
-        if(getType().equals(attributes.get(VirtualHost.STORE_TYPE)))
+        @SuppressWarnings("unchecked")
+        Map<String, Object> messageStoreSettings = (Map<String, Object>) attributes.get(VirtualHost.MESSAGE_STORE_SETTINGS);
+        if(messageStoreSettings != null && getType().equals(messageStoreSettings.get(MessageStore.STORE_TYPE)))
         {
-            Object storePath = attributes.get(VirtualHost.STORE_PATH);
+            Object storePath = messageStoreSettings.get(MessageStore.STORE_PATH);
             if(!(storePath instanceof String))
             {
-                throw new IllegalArgumentException("Attribute '"+ VirtualHost.STORE_PATH
+                throw new IllegalArgumentException("Setting '"+ MessageStore.STORE_PATH
                                                                +"' is required and must be of type String.");
 
             }
         }
-        if(getType().equals(attributes.get(VirtualHost.CONFIG_STORE_TYPE)))
+
+        @SuppressWarnings("unchecked")
+        Map<String, Object> configurationStoreSettings = (Map<String, Object>) attributes.get(VirtualHost.CONFIGURATION_STORE_SETTINGS);
+        if(configurationStoreSettings != null && getType().equals(configurationStoreSettings.get(DurableConfigurationStore.STORE_TYPE)))
         {
-            Object storePath = attributes.get(VirtualHost.CONFIG_STORE_PATH);
+            Object storePath = configurationStoreSettings.get(DurableConfigurationStore.STORE_PATH);
             if(!(storePath instanceof String))
             {
-                throw new IllegalArgumentException("Attribute '"+ VirtualHost.CONFIG_STORE_PATH
+                throw new IllegalArgumentException("Setting '"+ DurableConfigurationStore.STORE_PATH
                                                                +"' is required and must be of type String.");
 
             }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/EnvironmentFacadeFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/EnvironmentFacadeFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/EnvironmentFacadeFactory.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/EnvironmentFacadeFactory.java Tue Apr  1 10:35:33 2014
@@ -20,13 +20,18 @@
  */
 package org.apache.qpid.server.store.berkeleydb;
 
-import org.apache.qpid.server.model.VirtualHost;
+import java.util.Map;
 
 public interface EnvironmentFacadeFactory
 {
+    public static final String ENVIRONMENT_CONFIGURATION = "bdbEnvironmentConfig";
 
-    EnvironmentFacade createEnvironmentFacade(VirtualHost virtualHost, boolean isMessageStore);
+    EnvironmentFacade createEnvironmentFacade(Map<String, Object> storeSettings, EnvironmentFacadeTask... initialisationTasks);
 
     String getType();
 
+    public static interface EnvironmentFacadeTask
+    {
+        void execute(EnvironmentFacade facade);
+    }
 }

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacade.java Tue Apr  1 10:35:33 2014
@@ -25,6 +25,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.log4j.Logger;
+import org.apache.qpid.server.store.berkeleydb.EnvironmentFacadeFactory.EnvironmentFacadeTask;
 
 import com.sleepycat.je.Database;
 import com.sleepycat.je.DatabaseConfig;
@@ -42,7 +43,7 @@ public class StandardEnvironmentFacade i
 
     private Environment _environment;
 
-    public StandardEnvironmentFacade(String storePath, Map<String, String> attributes)
+    public StandardEnvironmentFacade(String storePath, Map<String, String> attributes, EnvironmentFacadeTask[] initialisationTasks)
     {
         _storePath = storePath;
 
@@ -74,6 +75,13 @@ public class StandardEnvironmentFacade i
         envConfig.setExceptionListener(new LoggingAsyncExceptionListener());
 
         _environment = new Environment(environmentPath, envConfig);
+        if (initialisationTasks != null)
+        {
+            for (EnvironmentFacadeTask task : initialisationTasks)
+            {
+                task.execute(this);
+            }
+        }
     }
 
     @Override

Modified: qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeFactory.java (original)
+++ qpid/trunk/qpid/java/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/StandardEnvironmentFacadeFactory.java Tue Apr  1 10:35:33 2014
@@ -20,51 +20,28 @@
  */
 package org.apache.qpid.server.store.berkeleydb;
 
-import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.qpid.server.configuration.BrokerProperties;
-import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.store.MessageStore;
 
 public class StandardEnvironmentFacadeFactory implements EnvironmentFacadeFactory
 {
 
     @SuppressWarnings("unchecked")
     @Override
-    public EnvironmentFacade createEnvironmentFacade(VirtualHost virtualHost, boolean isMessageStore)
+    public EnvironmentFacade createEnvironmentFacade(Map<String, Object> messageStoreSettings, EnvironmentFacadeTask... initialisationTasks)
     {
         Map<String, String> envConfigMap = new HashMap<String, String>();
         envConfigMap.putAll(EnvironmentFacade.ENVCONFIG_DEFAULTS);
 
-        Object environmentConfigurationAttributes = virtualHost.getAttribute(BDBMessageStore.ENVIRONMENT_CONFIGURATION);
+        Object environmentConfigurationAttributes = messageStoreSettings.get(ENVIRONMENT_CONFIGURATION);
         if (environmentConfigurationAttributes instanceof Map)
         {
             envConfigMap.putAll((Map<String, String>) environmentConfigurationAttributes);
         }
-
-        String name = virtualHost.getName();
-        final String defaultPath = System.getProperty(BrokerProperties.PROPERTY_QPID_WORK) + File.separator + "bdbstore" + File.separator + name;
-
-        String storeLocation;
-        if(isMessageStore)
-        {
-            storeLocation = (String) virtualHost.getAttribute(VirtualHost.STORE_PATH);
-            if(storeLocation == null)
-            {
-                storeLocation = defaultPath;
-            }
-        }
-        else // we are acting only as the durable config store
-        {
-            storeLocation = (String) virtualHost.getAttribute(VirtualHost.CONFIG_STORE_PATH);
-            if(storeLocation == null)
-            {
-                storeLocation = defaultPath;
-            }
-        }
-
-        return new StandardEnvironmentFacade(storeLocation, envConfigMap);
+        String storeLocation = (String) messageStoreSettings.get(MessageStore.STORE_PATH);
+        return new StandardEnvironmentFacade(storeLocation, envConfigMap, initialisationTasks);
     }
 
     @Override



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message