qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kw...@apache.org
Subject svn commit: r1583597 [6/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
Modified: qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/DefaultConnectionProviderFactory.java Tue Apr  1 10:35:33 2014
@@ -20,21 +20,23 @@
  */
 package org.apache.qpid.server.store.jdbc;
 
-import org.apache.qpid.server.model.VirtualHost;
+import java.util.Map;
+
 import org.apache.qpid.server.plugin.JDBCConnectionProviderFactory;
 
 public class DefaultConnectionProviderFactory implements JDBCConnectionProviderFactory
 {
 
+    public static final String TYPE = "DEFAULT";
+
     @Override
     public String getType()
     {
-        return "NONE";
+        return TYPE;
     }
 
     @Override
-    public ConnectionProvider getConnectionProvider(String connectionUrl,
-                                                    VirtualHost virtualHost)
+    public ConnectionProvider getConnectionProvider(String connectionUrl, Map<String, Object> settings)
     {
         return new DefaultConnectionProvider(connectionUrl);
     }

Modified: qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStore.java Tue Apr  1 10:35:33 2014
@@ -29,14 +29,15 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.CopyOnWriteArrayList;
+
 import org.apache.log4j.Logger;
-import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.plugin.JDBCConnectionProviderFactory;
 import org.apache.qpid.server.store.AbstractJDBCMessageStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.StoreException;
 import org.apache.qpid.server.store.StoreFuture;
 import org.apache.qpid.server.store.Transaction;
+import org.apache.qpid.server.util.MapValueConverter;
 
 /**
  * An implementation of a {@link org.apache.qpid.server.store.MessageStore} that uses a JDBC database as the persistence
@@ -48,10 +49,13 @@ public class JDBCMessageStore extends Ab
 
     private static final Logger _logger = Logger.getLogger(JDBCMessageStore.class);
 
-
     public static final String TYPE = "JDBC";
     public static final String CONNECTION_URL = "connectionURL";
-    public static final String CONFIG_CONNECTION_URL = "configConnectionURL";
+    public static final String CONNECTION_POOL = "connectionPool";
+    public static final String JDBC_BIG_INT_TYPE = "jdbcBigIntType";
+    public static final String JDBC_BYTES_FOR_BLOB = "jdbcBytesForBlob";
+    public static final String JDBC_VARBINARY_TYPE = "jdbcVarbinaryType";
+    public static final String JDBC_BLOB_TYPE = "jdbcBlobType";
 
     protected String _connectionURL;
     private ConnectionProvider _connectionProvider;
@@ -254,18 +258,24 @@ public class JDBCMessageStore extends Ab
     @Override
     protected void doClose()
     {
-        while(!_transactions.isEmpty())
-        {
-            RecordedJDBCTransaction txn = _transactions.get(0);
-            txn.abortTran();
-        }
         try
         {
-            _connectionProvider.close();
+            while(!_transactions.isEmpty())
+            {
+                RecordedJDBCTransaction txn = _transactions.get(0);
+                txn.abortTran();
+            }
         }
-        catch (SQLException e)
+        finally
         {
-            throw new StoreException("Unable to close connection provider ", e);
+            try
+            {
+                _connectionProvider.close();
+            }
+            catch (SQLException e)
+            {
+                throw new StoreException("Unable to close connection provider ", e);
+            }
         }
     }
 
@@ -276,28 +286,15 @@ public class JDBCMessageStore extends Ab
     }
 
 
-    protected void implementationSpecificConfiguration(String name,
-                                                       VirtualHost virtualHost)
+    protected void implementationSpecificConfiguration(String name, Map<String, Object> storeSettings)
         throws ClassNotFoundException, SQLException
     {
+        _connectionURL = String.valueOf(storeSettings.get(CONNECTION_URL));
+        Object poolAttribute = storeSettings.get(CONNECTION_POOL);
 
-        String connectionURL;
-        if(!isConfigStoreOnly())
-        {
-            connectionURL = virtualHost.getAttribute(CONNECTION_URL) == null
-                                   ? String.valueOf(virtualHost.getAttribute(VirtualHost.STORE_PATH))
-                                   : String.valueOf(virtualHost.getAttribute(CONNECTION_URL));
-        }
-        else
-        {
-            connectionURL = virtualHost.getAttribute(CONFIG_CONNECTION_URL) == null
-                                               ? String.valueOf(virtualHost.getAttribute(VirtualHost.CONFIG_STORE_PATH))
-                                               : String.valueOf(virtualHost.getAttribute(CONFIG_CONNECTION_URL));
-
-        }
         JDBCDetails details = null;
 
-        String[] components = connectionURL.split(":",3);
+        String[] components = _connectionURL.split(":",3);
         if(components.length >= 2)
         {
             String vendor = components[1];
@@ -306,15 +303,13 @@ public class JDBCMessageStore extends Ab
 
         if(details == null)
         {
-            getLogger().info("Do not recognize vendor from connection URL: " + connectionURL);
+            getLogger().info("Do not recognize vendor from connection URL: " + _connectionURL);
 
             // TODO - is there a better default than derby
             details = DERBY_DETAILS;
         }
 
-
-        Object poolAttribute = virtualHost.getAttribute("connectionPool");
-        String connectionPoolType = poolAttribute == null ? "DEFAULT" : String.valueOf(poolAttribute);
+        String connectionPoolType = poolAttribute == null ? DefaultConnectionProviderFactory.TYPE : String.valueOf(poolAttribute);
 
         JDBCConnectionProviderFactory connectionProviderFactory =
                 JDBCConnectionProviderFactory.FACTORIES.get(connectionPoolType);
@@ -324,44 +319,14 @@ public class JDBCMessageStore extends Ab
             connectionProviderFactory = new DefaultConnectionProviderFactory();
         }
 
-        _connectionProvider = connectionProviderFactory.getConnectionProvider(connectionURL, virtualHost);
-
-        _blobType = getStringAttribute(virtualHost, "jdbcBlobType",details.getBlobType());
-        _varBinaryType = getStringAttribute(virtualHost, "jdbcVarbinaryType",details.getVarBinaryType());
-        _useBytesMethodsForBlob = getBooleanAttribute(virtualHost, "jdbcBytesForBlob",details.isUseBytesMethodsForBlob());
-        _bigIntType = getStringAttribute(virtualHost, "jdbcBigIntType", details.getBigintType());
+        _connectionProvider = connectionProviderFactory.getConnectionProvider(_connectionURL, storeSettings);
+        _blobType = MapValueConverter.getStringAttribute(JDBC_BLOB_TYPE, storeSettings, details.getBlobType());
+        _varBinaryType = MapValueConverter.getStringAttribute(JDBC_VARBINARY_TYPE, storeSettings, details.getVarBinaryType());
+        _useBytesMethodsForBlob = MapValueConverter.getBooleanAttribute(JDBC_BYTES_FOR_BLOB, storeSettings, details.isUseBytesMethodsForBlob());
+        _bigIntType = MapValueConverter.getStringAttribute(JDBC_BIG_INT_TYPE, storeSettings, details.getBigintType());
     }
 
-
-    private String getStringAttribute(VirtualHost virtualHost, String attributeName, String defaultVal)
-    {
-        Object attrValue = virtualHost.getAttribute(attributeName);
-        if(attrValue != null)
-        {
-            return attrValue.toString();
-        }
-        return defaultVal;
-    }
-
-    private boolean getBooleanAttribute(VirtualHost virtualHost, String attributeName, boolean defaultVal)
-    {
-        Object attrValue = virtualHost.getAttribute(attributeName);
-        if(attrValue != null)
-        {
-            if(attrValue instanceof Boolean)
-            {
-                return ((Boolean) attrValue).booleanValue();
-            }
-            else if(attrValue instanceof String)
-            {
-                return Boolean.parseBoolean((String)attrValue);
-            }
-
-        }
-        return defaultVal;
-    }
-
-
+    @Override
     protected void storedSizeChange(int contentSize)
     {
     }
@@ -369,7 +334,7 @@ public class JDBCMessageStore extends Ab
     @Override
     public String getStoreLocation()
     {
-        return "";
+        return _connectionURL;
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/main/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreFactory.java Tue Apr  1 10:35:33 2014
@@ -20,9 +20,8 @@
  */
 package org.apache.qpid.server.store.jdbc;
 
-import java.util.HashMap;
 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;
@@ -51,56 +50,30 @@ public class JDBCMessageStoreFactory imp
     }
 
     @Override
-    public Map<String, Object> convertStoreConfiguration(Configuration storeConfiguration)
-    {
-        Map<String,Object> convertedMap = new HashMap<String,Object>();
-        convertedMap.put("jdbcBlobType", storeConfiguration.getString("sqlBlobType"));
-        convertedMap.put("jdbcVarbinaryType", storeConfiguration.getString("sqlVarbinaryType"));
-        if(storeConfiguration.containsKey("useBytesForBlob"))
-        {
-            convertedMap.put("jdbcUseBytesForBlob", storeConfiguration.getBoolean("useBytesForBlob"));
-        }
-        convertedMap.put("jdbcBigIntType", storeConfiguration.getString("sqlBigIntType"));
-        convertedMap.put("connectionPool", storeConfiguration.getString("pool.type"));
-        convertedMap.put("minConnectionsPerPartition", storeConfiguration.getInteger("pool.minConnectionsPerPartition",
-                null));
-        convertedMap.put("maxConnectionsPerPartition", storeConfiguration.getInteger("pool.maxConnectionsPerPartition",
-                null));
-        convertedMap.put("partitionCount", storeConfiguration.getInteger("pool.partitionCount", null));
-
-        return convertedMap;
-    }
-
-
-    @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(getType().equals(messageStoreSettings.get(MessageStore.STORE_TYPE)))
         {
-            Object connectionURL = attributes.get(JDBCMessageStore.CONNECTION_URL);
+            Object connectionURL = messageStoreSettings.get(JDBCMessageStore.CONNECTION_URL);
             if(!(connectionURL instanceof String))
             {
-                Object storePath = attributes.get(VirtualHost.STORE_PATH);
-                if(!(storePath instanceof String))
-                {
-                    throw new IllegalArgumentException("Attribute '"+ JDBCMessageStore.CONNECTION_URL
-                                                                   +"' is required and must be of type String.");
+                throw new IllegalArgumentException("Setting '"+ JDBCMessageStore.CONNECTION_URL
+                                                               +"' 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 connectionURL = attributes.get(JDBCMessageStore.CONFIG_CONNECTION_URL);
+            Object connectionURL = configurationStoreSettings.get(JDBCMessageStore.CONNECTION_URL);
             if(!(connectionURL instanceof String))
             {
-                Object storePath = attributes.get(VirtualHost.CONFIG_STORE_PATH);
-                if(!(storePath instanceof String))
-                {
-                    throw new IllegalArgumentException("Attribute '"+ JDBCMessageStore.CONFIG_CONNECTION_URL
-                                                                   +"' is required and must be of type String.");
-
-                }
+                throw new IllegalArgumentException("Setting '"+ JDBCMessageStore.CONNECTION_URL
+                        +"' is required and must be of type String.");
             }
         }
     }

Modified: qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/jdbc-store/src/test/java/org/apache/qpid/server/store/jdbc/JDBCMessageStoreTest.java Tue Apr  1 10:35:33 2014
@@ -25,16 +25,14 @@ import java.sql.DatabaseMetaData;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 
-import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.store.MessageStoreTestCase;
 
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.when;
-
 public class JDBCMessageStoreTest extends MessageStoreTestCase
 {
     private String _connectionURL;
@@ -54,29 +52,31 @@ public class JDBCMessageStoreTest extend
 
     public void testOnDelete() throws Exception
     {
-        String[] expectedTables = JDBCMessageStore.ALL_TABLES;
+        Set<String> expectedTables = JDBCMessageStore.MESSAGE_STORE_TABLE_NAMES;
         assertTablesExist(expectedTables, true);
-        getStore().close();
+        getStore().closeMessageStore();
         assertTablesExist(expectedTables, true);
         getStore().onDelete();
         assertTablesExist(expectedTables, false);
     }
 
     @Override
-    protected void setUpStoreConfiguration(VirtualHost virtualHost) throws Exception
+    protected Map<String, Object> getStoreSettings()
     {
         _connectionURL = "jdbc:derby:memory:/" + getTestName() + ";create=true";
-
-        when(virtualHost.getAttribute(eq("connectionURL"))).thenReturn(_connectionURL);
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(JDBCMessageStore.CONNECTION_URL, _connectionURL);
+        return messageStoreSettings;
     }
 
+
     @Override
     protected MessageStore createMessageStore()
     {
         return new JDBCMessageStore();
     }
 
-    private void assertTablesExist(String[] expectedTables, boolean exists) throws SQLException
+    private void assertTablesExist(Set<String> expectedTables, boolean exists) throws SQLException
     {
         Set<String> existingTables = getTableNames();
         for (String tableName : expectedTables)

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/pom.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/pom.xml?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/pom.xml (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/pom.xml Tue Apr  1 10:35:33 2014
@@ -55,6 +55,13 @@
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
+
+    <dependency>
+      <groupId>commons-beanutils</groupId>
+      <artifactId>commons-beanutils-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
   </dependencies>
 
   <build>

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/ManagedObjectRegistry.java Tue Apr  1 10:35:33 2014
@@ -20,10 +20,10 @@
  */
 package org.apache.qpid.server.jmx;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.common.Closeable;
 
 import javax.management.JMException;
+
 import java.io.IOException;
 
 /**
@@ -40,7 +40,7 @@ import java.io.IOException;
  */
 public interface ManagedObjectRegistry extends Closeable
 {
-    void start() throws IOException, ConfigurationException;
+    void start() throws IOException;
 
     void registerObject(ManagedObject managedObject) throws JMException;
 

Modified: qpid/trunk/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/memory-store/src/main/java/org/apache/qpid/server/store/MemoryMessageStoreFactory.java Tue Apr  1 10:35:33 2014
@@ -20,9 +20,8 @@
  */
 package org.apache.qpid.server.store;
 
-import java.util.Collections;
 import java.util.Map;
-import org.apache.commons.configuration.Configuration;
+
 import org.apache.qpid.server.plugin.MessageStoreFactory;
 
 public class MemoryMessageStoreFactory implements MessageStoreFactory
@@ -41,12 +40,6 @@ public class MemoryMessageStoreFactory i
     }
 
     @Override
-    public Map<String, Object> convertStoreConfiguration(Configuration configuration)
-    {
-        return Collections.emptyMap();
-    }
-
-    @Override
     public void validateAttributes(Map<String, Object> attributes)
     {
     }

Modified: qpid/trunk/qpid/java/build.deps
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/build.deps?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/build.deps (original)
+++ qpid/trunk/qpid/java/build.deps Tue Apr  1 10:35:33 2014
@@ -21,8 +21,6 @@ commons-beanutils-core=lib/required/comm
 commons-cli=lib/required/commons-cli-1.2.jar
 commons-codec=lib/required/commons-codec-1.6.jar
 commons-collections=lib/required/commons-collections-3.2.1.jar
-commons-configuration=lib/required/commons-configuration-1.8.jar
-commons-digester=lib/required/commons-digester-1.8.1.jar
 commons-lang=lib/required/commons-lang-2.6.jar
 commons-logging=lib/required/commons-logging-1.1.1.jar
 
@@ -67,8 +65,7 @@ dojo=lib/required/dojo-${dojo-version}.z
 jackson-core=lib/required/jackson-core-asl-1.9.0.jar
 jackson-mapper=lib/required/jackson-mapper-asl-1.9.0.jar
 
-commons-configuration.libs = ${commons-beanutils-core} ${commons-digester} \
-  ${commons-codec} ${commons-lang} ${commons-collections} ${commons-configuration}
+commons.libs = ${commons-codec} ${commons-lang} 
 
 common.libs=${slf4j-api}
 client.libs=${geronimo-jms}
@@ -77,20 +74,20 @@ amqp-1-0-client.libs=
 amqp-1-0-client-example.libs=${commons-cli}
 amqp-1-0-client-jms.libs=${geronimo-jms}
 amqp-1-0-client-websocket.libs = ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket}
-tools.libs=${commons-configuration.libs} ${log4j}
+tools.libs=${commons.libs} ${log4j}
 broker-core.libs=${commons-cli} ${commons-logging} ${log4j} ${slf4j-log4j} \
-    ${xalan} ${derby-db} ${commons-configuration.libs} \
+    ${xalan} ${derby-db} ${commons.libs} \
     ${jackson-core} ${jackson-mapper} ${jetty} ${jetty-continuation} ${jetty-security} ${jetty-http} ${jetty-io} ${jetty-servlet} ${jetty-util} ${servlet-api} ${jetty-websocket} ${bcel}
 
 #Borrow the broker-core libs, hack for release binary generation
 broker.libs=${broker-core.libs}
 
 broker-plugins-management-http.libs=${dojo} ${cryptojs}
-broker-plugins.libs=${log4j} ${commons-configuration.libs}
+broker-plugins.libs=${log4j} ${commons.libs}
 
 test.libs=${slf4j-log4j} ${log4j} ${junit} ${slf4j-api} ${mockito-all}
 
-perftests.libs=${geronimo-jms} ${slf4j-api} ${log4j} ${slf4j-log4j} ${commons-logging} ${commons-collections} ${commons-beanutils-core} ${commons-lang} ${gson-all} ${derby-db}
+perftests.libs=${geronimo-jms} ${slf4j-api} ${log4j} ${slf4j-log4j} ${commons-logging} ${commons-beanutils-core} ${commons-lang} ${commons-collections} ${gson-all} ${derby-db}
 
 management-common.libs=
 
@@ -107,7 +104,7 @@ qpid-test-utils.libs = ${test.libs} ${ge
 broker-plugins-access-control.test.libs=${test.libs}
 broker-plugins-management-amqp.test.libs=${test.libs}
 broker-plugins-management-http.test.libs=${test.libs}
-broker-plugins-management-jmx.test.libs=${test.libs}
+broker-plugins-management-jmx.test.libs=${commons-beanutils-core} ${test.libs}
 broker-plugins-jdbc-store.test.libs=${test.libs}
 broker-plugins-derby-store.test.libs=${test.libs}
 broker-plugins-memory-store.test.libs=${test.libs}

Modified: qpid/trunk/qpid/java/ivy.retrieve.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/ivy.retrieve.xml?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/ivy.retrieve.xml (original)
+++ qpid/trunk/qpid/java/ivy.retrieve.xml Tue Apr  1 10:35:33 2014
@@ -38,8 +38,6 @@
     <dependency org="commons-cli" name="commons-cli" rev="1.2" transitive="false"/>
     <dependency org="commons-codec" name="commons-codec" rev="1.6" transitive="false"/>
     <dependency org="commons-collections" name="commons-collections" rev="3.2.1" transitive="false"/>
-    <dependency org="commons-configuration" name="commons-configuration" rev="1.8" transitive="false"/>
-    <dependency org="commons-digester" name="commons-digester" rev="1.8.1" transitive="false"/>
     <dependency org="commons-lang" name="commons-lang" rev="2.6" transitive="false"/>
     <dependency org="commons-logging" name="commons-logging" rev="1.1.1" transitive="false"/>
     <dependency org="org.apache.bcel" name="bcel" rev="5.2" transitive="false"/>

Modified: qpid/trunk/qpid/java/module.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/module.xml?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/module.xml (original)
+++ qpid/trunk/qpid/java/module.xml Tue Apr  1 10:35:33 2014
@@ -418,6 +418,7 @@
     <propertyref name="java.naming.factory.initial"/>
     <propertyref name="java.naming.provider.url"/>
     <propertyref name="messagestore.class.name" />
+    <propertyref name="messagestore.type" />
     <propertyref name="max_prefetch"/>
 
     <propertyref name="QPID_HOME"/>

Modified: qpid/trunk/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json (original)
+++ qpid/trunk/qpid/java/perftests/example/config-stress-testing-manyp-c1-with-psfc.json Tue Apr  1 10:35:33 2014
@@ -7,7 +7,6 @@
           "_name": "direct://amq.direct//testQueue",
           "_attributes":
             {
-              "comment": "does not work yet - configure in virtualhost.xml",
               "x-qpid-capacity": 10485760,
               "x-qpid-flow-resume-capacity": 8388608
             }

Modified: qpid/trunk/qpid/java/pom.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/pom.xml?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/pom.xml (original)
+++ qpid/trunk/qpid/java/pom.xml Tue Apr  1 10:35:33 2014
@@ -75,9 +75,8 @@
     <profile.specific.excludes>JavaTransientExcludes Java010Excludes</profile.specific.excludes>
     <profile.broker.version>v0_10</profile.broker.version>
     <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
-    <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
     <profile.broker.persistent>false</profile.broker.persistent>
-    <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+    <profile.messagestore.type>Memory</profile.messagestore.type>
     <profile.broker.clean.between.tests>true</profile.broker.clean.between.tests>
   </properties>
 
@@ -163,9 +162,8 @@
                 <echo>[profile.test.excludes] ${profile.test.excludes}</echo>
                 <echo>[profile.broker.version] ${profile.broker.version}</echo>
                 <echo>[profile.qpid.broker_default_amqp_protocol_excludes] ${profile.qpid.broker_default_amqp_protocol_excludes}</echo>
-                <echo>[profile.broker.virtualhosts-config] ${profile.broker.virtualhosts-config}</echo>
                 <echo>[profile.broker.persistent] ${profile.broker.persistent}</echo>
-                <echo>[profile.messagestore.class.name] ${profile.messagestore.class.name}</echo>
+                <echo>[profile.messagestore.type] ${profile.messagestore.type}</echo>
             </tasks>
             </configuration>
           </execution>
@@ -256,13 +254,13 @@
             <test.excludes>${profile.test.excludes}</test.excludes>
             <broker.version>${profile.broker.version}</broker.version>
             <qpid.broker_default_amqp_protocol_excludes>${profile.qpid.broker_default_amqp_protocol_excludes}</qpid.broker_default_amqp_protocol_excludes>
-            <broker.virtualhosts-config>${profile.broker.virtualhosts-config}</broker.virtualhosts-config>
             <broker.persistent>${profile.broker.persistent}</broker.persistent>
-            <messagestore.class.name>${profile.messagestore.class.name}</messagestore.class.name>
+            <messagestore.type>${profile.messagestore.type}</messagestore.type>
             <broker.clean.between.tests>${profile.broker.clean.between.tests}</broker.clean.between.tests>
 
             <!-- This must be a child of qpid home currently due to the horrible mechanics of QBTC  -->
             <test.output>${qpid.home.qbtc.output}</test.output>
+            <broker.clean.between.tests>true</broker.clean.between.tests>
           </systemPropertyVariables>
         </configuration>
       </plugin>
@@ -440,9 +438,8 @@
         <profile.specific.excludes>JavaTransientExcludes Java010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_10</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>false</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>Memory</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -459,9 +456,8 @@
         <profile.specific.excludes>JavaTransientExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_9_1</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>false</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>Memory</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -478,9 +474,8 @@
         <profile.specific.excludes>JavaTransientExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_9</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>false</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.MemoryMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>Memory</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -497,9 +492,8 @@
         <profile.specific.excludes>JavaPersistentExcludes Java010Excludes JavaBDBExcludes</profile.specific.excludes>
         <profile.broker.version>v0_10</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>BDB</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -516,9 +510,8 @@
         <profile.specific.excludes>JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes</profile.specific.excludes>
         <profile.broker.version>v0_9_1</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>BDB</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -535,9 +528,8 @@
         <profile.specific.excludes>JavaPersistentExcludes XAExcludes JavaPre010Excludes JavaBDBExcludes</profile.specific.excludes>
         <profile.broker.version>v0_9</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-bdb.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.berkeleydb.BDBMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>BDB</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -554,9 +546,8 @@
         <profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes Java010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_10</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -573,9 +564,8 @@
         <profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_9_1</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -592,9 +582,8 @@
         <profile.specific.excludes>JavaPersistentExcludes JavaDerbyExcludes XAExcludes JavaPre010Excludes</profile.specific.excludes>
         <profile.broker.version>v0_9</profile.broker.version>
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
-        <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby-mem.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -613,7 +602,7 @@
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0</profile.qpid.broker_default_amqp_protocol_excludes>
         <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -632,7 +621,7 @@
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10</profile.qpid.broker_default_amqp_protocol_excludes>
         <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 
@@ -651,7 +640,7 @@
         <profile.qpid.broker_default_amqp_protocol_excludes>AMQP_1_0,AMQP_0_10,AMQP_0_9_1</profile.qpid.broker_default_amqp_protocol_excludes>
         <profile.broker.virtualhosts-config>${QPID_HOME}${file.separator}etc${file.separator}virtualhosts-systests-derby.xml</profile.broker.virtualhosts-config>
         <profile.broker.persistent>true</profile.broker.persistent>
-        <profile.messagestore.class.name>org.apache.qpid.server.store.derby.DerbyMessageStore</profile.messagestore.class.name>
+        <profile.messagestore.type>DERBY</profile.messagestore.type>
       </properties>
     </profile>
 

Modified: qpid/trunk/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java (original)
+++ qpid/trunk/qpid/java/qpid-test-utils/src/main/java/org/apache/qpid/test/utils/QpidTestCase.java Tue Apr  1 10:35:33 2014
@@ -22,6 +22,7 @@ package org.apache.qpid.test.utils;
 
 import junit.framework.TestCase;
 import junit.framework.TestResult;
+
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 
@@ -124,10 +125,7 @@ public class QpidTestCase extends TestCa
         }
     }
 
-    protected static final String MESSAGE_STORE_CLASS_NAME_KEY = "messagestore.class.name";
-    protected static final String CONFIGURATION_STORE_CLASS_NAME_KEY = "configurationstore.class.name";
-
-    protected static final String MEMORY_STORE_CLASS_NAME = "org.apache.qpid.server.store.MemoryMessageStore";
+    protected static final String MESSAGE_STORE_TYPE = "messagestore.type";
 
     private static List<String> _exclusionList;
 
@@ -151,12 +149,12 @@ public class QpidTestCase extends TestCa
         }
     }
 
-    public String getTestProfileMessageStoreClassName()
+    public String getTestProfileMessageStoreType()
     {
-        final String storeClass = System.getProperty(MESSAGE_STORE_CLASS_NAME_KEY);
-        _logger.debug("MESSAGE_STORE_CLASS_NAME_KEY " + storeClass);
+        final String storeType = System.getProperty(MESSAGE_STORE_TYPE);
+        _logger.debug(MESSAGE_STORE_TYPE + "=" + storeType);
 
-        return storeClass != null ? storeClass : MEMORY_STORE_CLASS_NAME ;
+        return storeType != null ? storeType : "TestableMemory";
     }
 
 

Modified: qpid/trunk/qpid/java/systests/etc/config-systests.json
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/etc/config-systests.json?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/etc/config-systests.json (original)
+++ qpid/trunk/qpid/java/systests/etc/config-systests.json Tue Apr  1 10:35:33 2014
@@ -22,7 +22,7 @@
   "name": "Broker",
   "defaultVirtualHost" : "test",
   "storeVersion": 1,
-  "modelVersion": "1.0",
+  "modelVersion": "1.4",
   "authenticationproviders" : [ {
     "name" : "plain",
     "type" : "PlainPasswordFile",
@@ -59,6 +59,10 @@
   }],
   "virtualhosts" : [ {
     "name" : "test",
-    "configPath" : "${broker.virtualhosts-config}"
+    "type" : "STANDARD",
+    "messageStoreSettings": {
+        "storeType": "${messagestore.type}",
+        "storePath" : "${QPID_WORK}/test/${test.port}"
+     }
   } ]
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/ssl/SSLTest.java Tue Apr  1 10:35:33 2014
@@ -25,9 +25,17 @@ import static org.apache.qpid.test.utils
 import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE;
 import static org.apache.qpid.test.utils.TestSSLConstants.TRUSTSTORE_PASSWORD;
 
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
 import java.util.Arrays;
-import javax.net.ssl.SSLSocket;
-import org.apache.commons.configuration.ConfigurationException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Session;
+
 import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.client.AMQTestConnection_0_10;
 import org.apache.qpid.jms.ConnectionURL;
@@ -36,15 +44,6 @@ import org.apache.qpid.server.model.Tran
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Session;
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
 public class SSLTest extends QpidBrokerTestCase
 {
     private static final String CERT_ALIAS_APP1 = "app1";
@@ -402,7 +401,7 @@ public class SSLTest extends QpidBrokerT
                                                 boolean sslOnly,
                                                 boolean needClientAuth,
                                                 boolean wantClientAuth,
-                                                boolean samePort) throws ConfigurationException
+                                                boolean samePort) throws Exception
     {
         if(isJavaBroker())
         {

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/AlertingTest.java Tue Apr  1 10:35:33 2014
@@ -20,8 +20,19 @@
 */
 package org.apache.qpid.server.logging;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.server.management.plugin.HttpManagement;
+import org.apache.qpid.server.model.AuthenticationProvider;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.security.auth.manager.AnonymousAuthenticationManagerFactory;
+import org.apache.qpid.systest.rest.RestTestHelper;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 import javax.jms.Connection;
 import javax.jms.Queue;
@@ -29,7 +40,7 @@ import javax.jms.Session;
 
 public class AlertingTest extends AbstractTestLogging
 {
-    private String VIRTUALHOST = "test";
+
     private Session _session;
     private Connection _connection;
     private Queue _destination;
@@ -41,9 +52,9 @@ public class AlertingTest extends Abstra
     public void setUp() throws Exception
     {
         _numMessages = 50;
-
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".housekeeping.checkPeriod", String.valueOf(ALERT_LOG_WAIT_PERIOD));
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", String.valueOf(_numMessages));
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        brokerConfiguration.setBrokerAttribute(Broker.VIRTUALHOST_HOUSEKEEPING_CHECK_PERIOD, String.valueOf(ALERT_LOG_WAIT_PERIOD));
+        brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, _numMessages);
 
         // Then we do the normal setup stuff like starting the broker, getting a connection etc.
         super.setUp();
@@ -140,8 +151,24 @@ public class AlertingTest extends Abstra
 
         _monitor.markDiscardPoint();
 
-        // Change max message count to 5, start broker and make sure that that's triggered at the right time
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost." + VIRTUALHOST + ".queues.maximumMessageCount", "5");
+        RestTestHelper restTestHelper = new RestTestHelper(findFreePort());
+        TestBrokerConfiguration config = getBrokerConfiguration();
+        config.addHttpManagementConfiguration();
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.PORT, restTestHelper.getHttpPort());
+        config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_JMX_PORT);
+        config.removeObjectConfiguration(TestBrokerConfiguration.ENTRY_NAME_RMI_PORT);
+
+        Map<String, Object> anonymousProviderAttributes = new HashMap<String, Object>();
+        anonymousProviderAttributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE);
+        anonymousProviderAttributes.put(AuthenticationProvider.NAME, "testAnonymous");
+        config.addAuthenticationProviderConfiguration(anonymousProviderAttributes);
+
+        // set password authentication provider on http port for the tests
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_PORT, Port.AUTHENTICATION_PROVIDER,
+                TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER);
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_HTTP_MANAGEMENT, HttpManagement.HTTP_BASIC_AUTHENTICATION_ENABLED, true);
+        config.setSaved(false);
+        restTestHelper.setUsernameAndPassword("webadmin", "webadmin");
 
         startBroker();
 
@@ -154,6 +181,12 @@ public class AlertingTest extends Abstra
         // Ensure the alert has not occurred yet
         assertLoggingNotYetOccured(MESSAGE_COUNT_ALERT);
 
+        // Change max message count to 5, start broker and make sure that that's triggered at the right time
+        TestBrokerConfiguration brokerConfiguration = getBrokerConfiguration();
+        brokerConfiguration.setBrokerAttribute(Broker.QUEUE_ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5);
+        brokerConfiguration.setSaved(false);
+
+        restTestHelper.submitRequest("/rest/queue/test/" + getTestQueueName(), "PUT", Collections.<String, Object>singletonMap(org.apache.qpid.server.model.Queue.ALERT_THRESHOLD_QUEUE_DEPTH_MESSAGES, 5));
         // Trigger the new value
         sendMessage(_session, _destination, 3);
         _session.commit();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/AbstractACLTestCase.java Tue Apr  1 10:35:33 2014
@@ -18,9 +18,7 @@
  */
 package org.apache.qpid.server.security.acl;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.lang.StringUtils;
-
 import org.apache.qpid.AMQException;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQConnectionURL;
@@ -33,6 +31,7 @@ import javax.jms.Connection;
 import javax.jms.ExceptionListener;
 import javax.jms.JMSException;
 import javax.naming.NamingException;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -95,12 +94,12 @@ public abstract class AbstractACLTestCas
         }
     }
 
-    public void writeACLFile(final String...rules) throws ConfigurationException, IOException
+    public void writeACLFile(final String...rules) throws IOException
     {
         writeACLFileUtil(this, rules);
     }
 
-    public static void writeACLFileUtil(QpidBrokerTestCase testcase, String...rules) throws ConfigurationException, IOException
+    public static void writeACLFileUtil(QpidBrokerTestCase testcase, String...rules) throws IOException
     {
         File aclFile = File.createTempFile(testcase.getClass().getSimpleName(), testcase.getName());
         aclFile.deleteOnExit();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationTest.java Tue Apr  1 10:35:33 2014
@@ -38,7 +38,6 @@ import java.util.Map;
 import javax.jms.Connection;
 import javax.jms.JMSException;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.client.AMQConnectionURL;
 import org.apache.qpid.management.common.mbeans.ManagedConnection;
 import org.apache.qpid.server.model.AuthenticationProvider;
@@ -328,12 +327,12 @@ public class ExternalAuthenticationTest 
         return getConnection(new AMQConnectionURL(url));
     }
 
-    private void setCommonBrokerSSLProperties(boolean needClientAuth) throws ConfigurationException
+    private void setCommonBrokerSSLProperties(boolean needClientAuth)
     {
         setCommonBrokerSSLProperties(needClientAuth, Collections.singleton(TestBrokerConfiguration.ENTRY_NAME_SSL_TRUSTSTORE));
     }
 
-    private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames) throws ConfigurationException
+    private void setCommonBrokerSSLProperties(boolean needClientAuth, Collection<String> trustStoreNames)
     {
         TestBrokerConfiguration config = getBrokerConfiguration();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/MessageStoreTest.java Tue Apr  1 10:35:33 2014
@@ -21,10 +21,15 @@
 package org.apache.qpid.server.store;
 
 
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
 import java.util.ArrayList;
 import java.util.Collection;
-
-import org.apache.commons.configuration.PropertiesConfiguration;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.common.AMQPFilterTypes;
@@ -34,41 +39,34 @@ import org.apache.qpid.framing.ContentHe
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl;
-import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.DirectExchange;
 import org.apache.qpid.server.exchange.ExchangeImpl;
 import org.apache.qpid.server.exchange.TopicExchange;
+import org.apache.qpid.server.logging.EventLogger;
 import org.apache.qpid.server.message.InstanceProperties;
 import org.apache.qpid.server.message.MessageSource;
 import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.ExclusivityPolicy;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Queue;
-import org.apache.qpid.server.protocol.v0_8.AMQMessage;
-import org.apache.qpid.server.protocol.v0_8.MessageMetaData;
-import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.UUIDGenerator;
 import org.apache.qpid.server.plugin.ExchangeType;
-import org.apache.qpid.server.queue.PriorityQueue;
+import org.apache.qpid.server.protocol.v0_8.AMQMessage;
+import org.apache.qpid.server.protocol.v0_8.MessageMetaData;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.ConflationQueue;
+import org.apache.qpid.server.queue.PriorityQueue;
 import org.apache.qpid.server.queue.StandardQueue;
 import org.apache.qpid.server.txn.AutoCommitTransaction;
 import org.apache.qpid.server.txn.ServerTransaction;
 import org.apache.qpid.server.util.BrokerTestHelper;
+import org.apache.qpid.server.virtualhost.StandardVirtualHostFactory;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 import org.apache.qpid.test.utils.QpidTestCase;
 import org.apache.qpid.util.FileUtils;
 
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
 /**
  * This tests the MessageStores by using the available interfaces.
  *
@@ -104,8 +102,6 @@ public class MessageStoreTest extends Qp
 
     private String queueOwner = "MST";
 
-    private PropertiesConfiguration _config;
-
     private VirtualHost _virtualHost;
     private org.apache.qpid.server.model.VirtualHost _virtualHostModel;
     private Broker _broker;
@@ -116,15 +112,19 @@ public class MessageStoreTest extends Qp
         super.setUp();
         BrokerTestHelper.setUp();
 
-        _storePath = System.getProperty("QPID_WORK") + File.separator + getName();
-
-        _config = new PropertiesConfiguration();
-        _config.addProperty("store.class", getTestProfileMessageStoreClassName());
-        _config.addProperty("store.environment-path", _storePath);
-        _virtualHostModel = mock(org.apache.qpid.server.model.VirtualHost.class);
-        when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.STORE_PATH))).thenReturn(_storePath);
+        String hostName = getName();
+        _storePath = System.getProperty("QPID_WORK", TMP_FOLDER + File.separator + getTestName()) + File.separator + hostName;
 
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_PATH, _storePath);
+        messageStoreSettings.put(MessageStore.STORE_TYPE, getTestProfileMessageStoreType());
 
+        _virtualHostModel = mock(org.apache.qpid.server.model.VirtualHost.class);
+        when(_virtualHostModel.getMessageStoreSettings()).thenReturn(messageStoreSettings);
+        when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.TYPE))).thenReturn(StandardVirtualHostFactory.TYPE);
+        when(_virtualHostModel.getAttribute(eq(org.apache.qpid.server.model.VirtualHost.NAME))).thenReturn(hostName);
+        when(_virtualHostModel.getType()).thenReturn(StandardVirtualHostFactory.TYPE);
+        when(_virtualHostModel.getName()).thenReturn(hostName);
 
         cleanup(new File(_storePath));
 
@@ -138,7 +138,7 @@ public class MessageStoreTest extends Qp
         return _storePath;
     }
 
-    protected org.apache.qpid.server.model.VirtualHost getVirtualHostModel()
+    protected org.apache.qpid.server.model.VirtualHost<?> getVirtualHostModel()
     {
         return _virtualHostModel;
     }
@@ -165,11 +165,6 @@ public class MessageStoreTest extends Qp
         return _virtualHost;
     }
 
-    public PropertiesConfiguration getConfig()
-    {
-        return _config;
-    }
-
     protected void reloadVirtualHost()
     {
         VirtualHost original = getVirtualHost();
@@ -189,7 +184,7 @@ public class MessageStoreTest extends Qp
 
         try
         {
-            _virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostConfiguration(getClass().getName(), _config, _broker),new VirtualHostRegistry(_broker.getEventLogger()),getVirtualHostModel());
+            _virtualHost = BrokerTestHelper.createVirtualHost(new VirtualHostRegistry(new EventLogger()), getVirtualHostModel());
             when(_virtualHostModel.getId()).thenReturn(_virtualHost.getId());
 
             ConfiguredObjectRecord objectRecord = mock(ConfiguredObjectRecord.class);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/QuotaMessageStore.java Tue Apr  1 10:35:33 2014
@@ -20,43 +20,37 @@
  */
 package org.apache.qpid.server.store;
 
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 
 import org.apache.qpid.server.message.EnqueueableMessage;
 import org.apache.qpid.server.message.MessageContentSource;
-import org.apache.qpid.server.model.VirtualHost;
+import org.apache.qpid.server.model.ConfiguredObject;
 
-public class
-        QuotaMessageStore extends NullMessageStore
+public class QuotaMessageStore extends NullMessageStore
 {
+    public static final String TYPE = "QuotaMessageStore";
     private final AtomicLong _messageId = new AtomicLong(1);
-    private final AtomicBoolean _closed = new AtomicBoolean(false);
 
     private long _totalStoreSize;;
     private boolean _limitBusted;
     private long _persistentSizeLowThreshold;
     private long _persistentSizeHighThreshold;
 
-    private final StateManager _stateManager;
     private final EventManager _eventManager = new EventManager();
 
-    public QuotaMessageStore()
-    {
-        _stateManager = new StateManager(_eventManager);
-    }
 
     @Override
-    public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
+    public void openMessageStore(ConfiguredObject<?> parent, Map<String, Object> messageStoreSettings)
     {
-        Object overfullAttr = virtualHost.getAttribute(MessageStoreConstants.OVERFULL_SIZE_ATTRIBUTE);
+        Object overfullAttr = messageStoreSettings.get(MessageStore.OVERFULL_SIZE);
         _persistentSizeHighThreshold = overfullAttr == null
                                        ? Long.MAX_VALUE
                                        : overfullAttr instanceof Number
                                          ? ((Number)overfullAttr).longValue()
                                          : Long.parseLong(overfullAttr.toString());
 
-        Object underfullAttr = virtualHost.getAttribute(MessageStoreConstants.UNDERFULL_SIZE_ATTRIBUTE);
+        Object underfullAttr = messageStoreSettings.get(MessageStore.UNDERFULL_SIZE);
 
         _persistentSizeLowThreshold =  overfullAttr == null
                                        ? _persistentSizeHighThreshold
@@ -69,22 +63,8 @@ public class
         {
             _persistentSizeLowThreshold = _persistentSizeHighThreshold;
         }
-        _stateManager.attainState(State.INITIALISING);
     }
 
-    @Override
-    public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler recoveryHandler,
-                                      TransactionLogRecoveryHandler tlogRecoveryHandler)
-    {
-        _stateManager.attainState(State.INITIALISED);
-    }
-
-    @Override
-    public void activate()
-    {
-        _stateManager.attainState(State.ACTIVATING);
-        _stateManager.attainState(State.ACTIVE);
-    }
 
     @SuppressWarnings("unchecked")
     @Override
@@ -150,16 +130,6 @@ public class
     }
 
     @Override
-    public void close()
-    {
-        if (_closed.compareAndSet(false, true))
-        {
-            _stateManager.attainState(State.CLOSING);
-            _stateManager.attainState(State.CLOSED);
-        }
-    }
-
-    @Override
     public void addEventListener(EventListener eventListener, Event... events)
     {
         _eventManager.addEventListener(eventListener, events);
@@ -189,6 +159,6 @@ public class
     @Override
     public String getStoreType()
     {
-        return "QUOTA";
+        return TYPE;
     }
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java Tue Apr  1 10:35:33 2014
@@ -21,92 +21,60 @@
 package org.apache.qpid.server.store;
 
 import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
 import java.util.Map;
 import java.util.UUID;
-import org.apache.log4j.Logger;
+import java.util.concurrent.ConcurrentHashMap;
 
+import org.apache.log4j.Logger;
 import org.apache.qpid.server.message.EnqueueableMessage;
-import org.apache.qpid.server.message.ServerMessage;
-import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.util.ServerScopedRuntimeException;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.plugin.MessageStoreFactory;
 
 public class SlowMessageStore implements MessageStore, DurableConfigurationStore
 {
     private static final Logger _logger = Logger.getLogger(SlowMessageStore.class);
-    private static final String DELAYS = "delays";
+
+    public static final String TYPE = "SLOW";
+    public static final String DELAYS = "delays";
+    public static final String REAL_STORE = "realStore";
+
+    private static final String DEFAULT_DELAY = "default";
+    private static final String PRE = "pre";
+    private static final String POST = "post";
+
     private HashMap<String, Long> _preDelays = new HashMap<String, Long>();
     private HashMap<String, Long> _postDelays = new HashMap<String, Long>();
     private long _defaultDelay = 0L;
-    private MessageStore _realStore = new MessageStoreCreator().createMessageStore("Memory");
-    private DurableConfigurationStore _durableConfigurationStore = (DurableConfigurationStore) _realStore;
-    private static final String PRE = "pre";
-    private static final String POST = "post";
-    private String DEFAULT_DELAY = "default";
+    private MessageStore _realMessageStore = null;
+    private DurableConfigurationStore _realDurableConfigurationStore = null;
 
-    // ***** MessageStore Interface.
+    private Map<EventListener, Event[]> _eventListeners = new ConcurrentHashMap<EventListener, Event[]>();
 
-    public void configureConfigStore(VirtualHost virtualHost, ConfigurationRecoveryHandler recoveryHandler)
+    @Override
+    public void openConfigurationStore(ConfiguredObject<?> parent, Map<String, Object> storeSettings)
     {
-        _logger.info("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
-
-        Object delaysAttr = virtualHost.getAttribute("slowMessageStoreDelays");
-
-        Map delays = (delaysAttr instanceof Map) ? (Map) delaysAttr : Collections.emptyMap();
-        configureDelays(delays);
-
-        final Object realStoreAttr = virtualHost.getAttribute("realStore");
-        String messageStoreClass = realStoreAttr == null ? null : realStoreAttr.toString();
-
-        if (delays.containsKey(DEFAULT_DELAY))
+        if (storeSettings != null && storeSettings.get(REAL_STORE) != null)
         {
-            _defaultDelay = Long.parseLong(String.valueOf(delays.get(DEFAULT_DELAY)));
+            final String realStore = (String) storeSettings.get(REAL_STORE);
+            _realDurableConfigurationStore = new DurableConfigurationStoreCreator().createMessageStore(realStore);
+            _realDurableConfigurationStore.openConfigurationStore(parent, storeSettings);
         }
+    }
 
-        if (messageStoreClass != null)
-        {
-            try
-            {
-                Class<?> clazz = Class.forName(messageStoreClass);
-
-                Object o = clazz.newInstance();
-
-                if (!(o instanceof MessageStore))
-                {
-                    throw new ClassCastException("Message store class must implement " + MessageStore.class + ". Class " + clazz +
-                                                 " does not.");
-                }
-                _realStore = (MessageStore) o;
-                if(o instanceof DurableConfigurationStore)
-                {
-                    _durableConfigurationStore = (DurableConfigurationStore)o;
-                }
-            }
-            catch (ClassNotFoundException e)
-            {
-                throw new ServerScopedRuntimeException("Unable to find message store class", e);
-            }
-            catch (InstantiationException e)
-            {
-                throw new ServerScopedRuntimeException("Unable to initialise message store class", e);
-            }
-            catch (IllegalAccessException e)
-            {
-                throw new ServerScopedRuntimeException("Unable to access message store class", e);
-            }
-        }
-        _durableConfigurationStore.configureConfigStore(virtualHost, recoveryHandler);
-
+    @Override
+    public void recoverConfigurationStore(ConfigurationRecoveryHandler recoveryHandler)
+    {
+        _realDurableConfigurationStore.recoverConfigurationStore(recoveryHandler);
     }
 
-    private void configureDelays(Map<Object, Object> config)
+    private void configureDelays(Map<String, Object> delays)
     {
 
-        for(Map.Entry<Object, Object> entry : config.entrySet())
+        for(Map.Entry<String, Object> entry : delays.entrySet())
         {
-            String key = String.valueOf(entry.getKey());
+            String key = entry.getKey();
             if (key.startsWith(PRE))
             {
                 _preDelays.put(key.substring(PRE.length()), Long.parseLong(String.valueOf(entry.getValue())));
@@ -165,30 +133,67 @@ public class SlowMessageStore implements
         }
     }
 
-
-    public void configureMessageStore(VirtualHost virtualHost, MessageStoreRecoveryHandler messageRecoveryHandler,
-                                      TransactionLogRecoveryHandler tlogRecoveryHandler)
+    @Override
+    public void openMessageStore(ConfiguredObject<?> parent, Map<String, Object> messageStoreSettings)
     {
-        _realStore.configureMessageStore(virtualHost, messageRecoveryHandler, tlogRecoveryHandler);
+        Object delaysAttr = messageStoreSettings.get(DELAYS);
+
+        @SuppressWarnings({ "unchecked" })
+        Map<String,Object> delays = (delaysAttr instanceof Map) ? (Map<String,Object>) delaysAttr : Collections.<String,Object>emptyMap();
+        configureDelays(delays);
+
+        if (delays.containsKey(DEFAULT_DELAY))
+        {
+            _defaultDelay = Long.parseLong(String.valueOf(delays.get(DEFAULT_DELAY)));
+        }
+
+        final Object realStoreAttr = messageStoreSettings.get(REAL_STORE) == null ? MemoryMessageStore.TYPE : messageStoreSettings.get(REAL_STORE);
+        final String realStore = (String) realStoreAttr;
+        _realMessageStore = MessageStoreFactory.FACTORY_LOADER.get(realStore).createMessageStore();
+
+        if (!_eventListeners.isEmpty())
+        {
+            for (Iterator<Map.Entry<EventListener, Event[]>> it = _eventListeners.entrySet().iterator(); it.hasNext();)
+            {
+                Map.Entry<EventListener, Event[]> entry = it.next();
+                _realMessageStore.addEventListener(entry.getKey(), entry.getValue());
+                it.remove();
+            }
+        }
+        _realMessageStore.openMessageStore(parent, messageStoreSettings);
+
+        if (_realDurableConfigurationStore == null)
+        {
+            _realDurableConfigurationStore = (DurableConfigurationStore) _realMessageStore;
+        }
+
     }
 
-    public void close()
+    @Override
+    public void closeMessageStore()
     {
         doPreDelay("close");
-        _realStore.close();
+        _realMessageStore.closeMessageStore();
         doPostDelay("close");
     }
 
+    @Override
+    public void closeConfigurationStore()
+    {
+        _realDurableConfigurationStore.closeConfigurationStore();
+    }
+
+    @Override
     public <M extends StorableMessageMetaData> StoredMessage<M> addMessage(M metaData)
     {
-        return _realStore.addMessage(metaData);
+        return _realMessageStore.addMessage(metaData);
     }
 
     @Override
     public void create(ConfiguredObjectRecord record) throws StoreException
     {
         doPreDelay("create");
-        _durableConfigurationStore.create(record);
+        _realDurableConfigurationStore.create(record);
         doPostDelay("create");
     }
 
@@ -197,7 +202,7 @@ public class SlowMessageStore implements
     public UUID[] remove(final ConfiguredObjectRecord... objects) throws StoreException
     {
         doPreDelay("remove");
-        UUID[] removed = _durableConfigurationStore.remove(objects);
+        UUID[] removed = _realDurableConfigurationStore.remove(objects);
         doPostDelay("remove");
         return removed;
     }
@@ -206,37 +211,23 @@ public class SlowMessageStore implements
     public void update(boolean createIfNecessary, ConfiguredObjectRecord... records) throws StoreException
     {
         doPreDelay("update");
-        _durableConfigurationStore.update(createIfNecessary, records);
+        _realDurableConfigurationStore.update(createIfNecessary, records);
         doPostDelay("update");
     }
 
+    @Override
     public Transaction newTransaction()
     {
         doPreDelay("beginTran");
-        Transaction txn = new SlowTransaction(_realStore.newTransaction());
+        Transaction txn = new SlowTransaction(_realMessageStore.newTransaction());
         doPostDelay("beginTran");
         return txn;
     }
 
-
+    @Override
     public boolean isPersistent()
     {
-        return _realStore.isPersistent();
-    }
-
-    public void storeMessageHeader(Long messageNumber, ServerMessage message)
-    {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public void storeContent(Long messageNumber, long offset, ByteBuffer body)
-    {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public ServerMessage getMessage(Long messageNumber)
-    {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return _realMessageStore.isPersistent();
     }
 
     private class SlowTransaction implements Transaction
@@ -248,6 +239,7 @@ public class SlowMessageStore implements
             _underlying = underlying;
         }
 
+        @Override
         public void enqueueMessage(TransactionLogResource queue, EnqueueableMessage message)
         {
             doPreDelay("enqueueMessage");
@@ -255,6 +247,7 @@ public class SlowMessageStore implements
             doPostDelay("enqueueMessage");
         }
 
+        @Override
         public void dequeueMessage(TransactionLogResource queue, EnqueueableMessage message)
         {
             doPreDelay("dequeueMessage");
@@ -262,6 +255,7 @@ public class SlowMessageStore implements
             doPostDelay("dequeueMessage");
         }
 
+        @Override
         public void commitTran()
         {
             doPreDelay("commitTran");
@@ -269,6 +263,7 @@ public class SlowMessageStore implements
             doPostDelay("commitTran");
         }
 
+        @Override
         public StoreFuture commitTranAsync()
         {
             doPreDelay("commitTran");
@@ -277,6 +272,7 @@ public class SlowMessageStore implements
             return future;
         }
 
+        @Override
         public void abortTran()
         {
             doPreDelay("abortTran");
@@ -284,11 +280,13 @@ public class SlowMessageStore implements
             doPostDelay("abortTran");
         }
 
+        @Override
         public void removeXid(long format, byte[] globalId, byte[] branchId)
         {
             _underlying.removeXid(format, globalId, branchId);
         }
 
+        @Override
         public void recordXid(long format, byte[] globalId, byte[] branchId, Record[] enqueues, Record[] dequeues)
         {
             _underlying.recordXid(format, globalId, branchId, enqueues, dequeues);
@@ -296,33 +294,40 @@ public class SlowMessageStore implements
     }
 
     @Override
-    public void activate()
+    public void recoverMessageStore(MessageStoreRecoveryHandler messageRecoveryHandler, TransactionLogRecoveryHandler transactionLogRecoveryHandler)
     {
-       _realStore.activate();
+       _realMessageStore.recoverMessageStore(messageRecoveryHandler, transactionLogRecoveryHandler);
     }
 
     @Override
     public void addEventListener(EventListener eventListener, Event... events)
     {
-        _realStore.addEventListener(eventListener, events);
+        if (_realMessageStore == null)
+        {
+            _eventListeners .put(eventListener, events);
+        }
+        else
+        {
+            _realMessageStore.addEventListener(eventListener, events);
+        }
     }
 
     @Override
     public String getStoreLocation()
     {
-        return _realStore.getStoreLocation();
+        return _realMessageStore.getStoreLocation();
     }
 
     @Override
     public String getStoreType()
     {
-        return "SLOW";
+        return TYPE;
     }
 
     @Override
     public void onDelete()
     {
-        _realStore.onDelete();
+        _realMessageStore.onDelete();
     }
 
 }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStoreFactory.java Tue Apr  1 10:35:33 2014
@@ -19,10 +19,8 @@ package org.apache.qpid.server.store;/*
  *
  */
 
-import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
-import org.apache.commons.configuration.Configuration;
+
 import org.apache.qpid.server.plugin.MessageStoreFactory;
 
 public class SlowMessageStoreFactory implements MessageStoreFactory
@@ -30,7 +28,7 @@ public class SlowMessageStoreFactory imp
     @Override
     public String getType()
     {
-        return "SLOW";
+        return SlowMessageStore.TYPE;
     }
 
     @Override
@@ -40,43 +38,6 @@ public class SlowMessageStoreFactory imp
     }
 
     @Override
-    public Map<String, Object> convertStoreConfiguration(Configuration storeConfiguration)
-    {
-        Map<String, Object> convertedMap = new HashMap<String, Object>();
-        Configuration delaysConfig = storeConfiguration.subset("delays");
-
-        @SuppressWarnings("unchecked")
-        Iterator<String> delays = delaysConfig.getKeys();
-
-        Map<String,Long> delaysMap = new HashMap<String, Long>();
-
-        while (delays.hasNext())
-        {
-            String key = delays.next();
-
-            if (key.endsWith("pre"))
-            {
-                delaysMap.put("pre"+key.substring(0, key.length() - 4), delaysConfig.getLong(key));
-            }
-            else if (key.endsWith("post"))
-            {
-                delaysMap.put("post"+key.substring(0, key.length() - 5), delaysConfig.getLong(key));
-            }
-        }
-
-        if(!delaysMap.isEmpty())
-        {
-            convertedMap.put("slowMessageStoreDelays",delaysMap);
-        }
-
-
-        convertedMap.put("realStore", storeConfiguration.getString("realStore", null));
-
-
-        return convertedMap;
-    }
-
-    @Override
     public void validateAttributes(Map<String, Object> attributes)
     {
     }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/StoreOverfullTest.java Tue Apr  1 10:35:33 2014
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.server.store;
 
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -37,7 +39,9 @@ import org.apache.qpid.client.AMQDestina
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
+import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
 public class StoreOverfullTest extends QpidBrokerTestCase
 {
@@ -60,9 +64,13 @@ public class StoreOverfullTest extends Q
 
     public void setUp() throws Exception
     {
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost.test.store.class", QuotaMessageStore.class.getName());
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost.test.store.overfull-size", String.valueOf(OVERFULL_SIZE));
-        setVirtualHostConfigurationProperty("virtualhosts.virtualhost.test.store.underfull-size", String.valueOf(UNDERFULL_SIZE));
+        Map<String, Object> messageStoreSettings = new HashMap<String, Object>();
+        messageStoreSettings.put(MessageStore.STORE_TYPE, QuotaMessageStore.TYPE);
+        messageStoreSettings.put(MessageStore.OVERFULL_SIZE, OVERFULL_SIZE);
+        messageStoreSettings.put(MessageStore.UNDERFULL_SIZE, UNDERFULL_SIZE);
+
+        TestBrokerConfiguration config = getBrokerConfiguration();
+        config.setObjectAttribute(TestBrokerConfiguration.ENTRY_NAME_VIRTUAL_HOST, VirtualHost.MESSAGE_STORE_SETTINGS, messageStoreSettings);
 
         super.setUp();
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AccessControlProviderRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AccessControlProviderRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AccessControlProviderRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AccessControlProviderRestTest.java Tue Apr  1 10:35:33 2014
@@ -27,7 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.AccessControlProvider;
@@ -54,7 +53,7 @@ public class AccessControlProviderRestTe
                           "ACL DENY-LOG ALL ALL";
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         getRestTestHelper().configureTemporaryPasswordFile(this, ALLOWED_USER, DENIED_USER, OTHER_USER);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AnonymousAccessRestTest.java Tue Apr  1 10:35:33 2014
@@ -24,7 +24,6 @@ import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.AuthenticationProvider;
 import org.apache.qpid.server.model.Broker;
@@ -46,7 +45,7 @@ public class AnonymousAccessRestTest ext
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         super.customizeConfiguration();
         TestBrokerConfiguration config = getBrokerConfiguration();

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java Tue Apr  1 10:35:33 2014
@@ -31,7 +31,18 @@ import java.util.Map;
 import javax.jms.JMSException;
 
 import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.server.model.*;
+import org.apache.qpid.server.model.Binding;
+import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.ConfiguredObject;
+import org.apache.qpid.server.model.Connection;
+import org.apache.qpid.server.model.Exchange;
+import org.apache.qpid.server.model.ExclusivityPolicy;
+import org.apache.qpid.server.model.LifetimePolicy;
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.Queue;
+import org.apache.qpid.server.model.State;
+import org.apache.qpid.server.model.VirtualHost;
 import org.apache.qpid.server.model.adapter.AbstractConfiguredObject;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
@@ -50,11 +61,9 @@ public class Asserts
                                 ConfiguredObject.LAST_UPDATED_TIME,
                                 ConfiguredObject.DESCRIPTION,
                                 VirtualHost.SUPPORTED_QUEUE_TYPES,
-                                VirtualHost.STORE_PATH,
-                                VirtualHost.CONFIG_PATH,
                                 VirtualHost.TYPE,
-                                VirtualHost.CONFIG_STORE_PATH,
-                                VirtualHost.CONFIG_STORE_TYPE);
+                                VirtualHost.CONFIGURATION_STORE_SETTINGS,
+                                VirtualHost.SECURITY_ACL);
 
         assertEquals("Unexpected value of attribute " + VirtualHost.NAME,
                      virtualHostName,
@@ -146,7 +155,7 @@ public class Asserts
         @SuppressWarnings("unchecked")
         Map<String, Object> statistics = (Map<String, Object>) queueData.get(Asserts.STATISTICS_ATTRIBUTE);
 
-        Asserts.assertAttributesPresent(statistics, 
+        Asserts.assertAttributesPresent(statistics,
                                         "bindingCount",
                                         "consumerCount",
                                         "consumerCountWithCredit",
@@ -226,7 +235,7 @@ public class Asserts
 
         @SuppressWarnings("unchecked")
         Map<String, Object> statistics = (Map<String, Object>) connectionData.get(STATISTICS_ATTRIBUTE);
- 
+
 
         assertAttributesPresent(statistics,
                                 "bytesIn",

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BasicAuthRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BasicAuthRestTest.java?rev=1583597&r1=1583596&r2=1583597&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BasicAuthRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BasicAuthRestTest.java Tue Apr  1 10:35:33 2014
@@ -29,10 +29,8 @@ import java.util.Collections;
 
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.commons.configuration.ConfigurationException;
 import org.apache.qpid.server.management.plugin.HttpManagement;
 import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
 import org.apache.qpid.test.utils.TestBrokerConfiguration;
 
@@ -49,12 +47,12 @@ public class BasicAuthRestTest extends Q
     }
 
     @Override
-    protected void customizeConfiguration() throws ConfigurationException, IOException
+    protected void customizeConfiguration() throws IOException
     {
         //do nothing, we will configure this locally
     }
 
-    private void configure(boolean useSsl) throws ConfigurationException, IOException
+    private void configure(boolean useSsl) throws IOException
     {
         getRestTestHelper().setUseSsl(useSsl);
         if (useSsl)



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


Mime
View raw message