qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r745799 [2/3] - in /qpid/trunk/qpid/java: broker/src/main/java/org/apache/qpid/server/ broker/src/main/java/org/apache/qpid/server/configuration/ broker/src/main/java/org/apache/qpid/server/exchange/ broker/src/main/java/org/apache/qpid/ser...
Date Thu, 19 Feb 2009 10:03:24 GMT
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java Thu Feb 19 10:03:18 2009
@@ -1,28 +1,9 @@
 package org.apache.qpid.server.queue;
 
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.subscription.Subscription;
-import org.apache.qpid.server.subscription.SubscriptionList;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.management.ManagedObject;
-import org.apache.qpid.server.transactionlog.TransactionLog;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.pool.ReadWriteRunnable;
-import org.apache.qpid.pool.ReferenceCountingExecutorService;
-import org.apache.qpid.configuration.Configured;
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-
-import javax.management.JMException;
-import java.util.List;
-import java.util.Set;
 import java.util.ArrayList;
 import java.util.EnumSet;
+import java.util.List;
+import java.util.Set;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Executor;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -30,6 +11,25 @@
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReference;
 
+import javax.management.JMException;
+
+import org.apache.log4j.Logger;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.pool.ReadWriteRunnable;
+import org.apache.qpid.pool.ReferenceCountingExecutorService;
+import org.apache.qpid.server.configuration.QueueConfiguration;
+import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.management.ManagedObject;
+import org.apache.qpid.server.output.ProtocolOutputConverter;
+import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.store.StoreContext;
+import org.apache.qpid.server.subscription.Subscription;
+import org.apache.qpid.server.subscription.SubscriptionList;
+import org.apache.qpid.server.transactionlog.TransactionLog;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+
 /*
 *
 * Licensed to the Apache Software Foundation (ASF) under one
@@ -91,24 +91,19 @@
     private final AtomicLong _totalMessagesReceived = new AtomicLong();
 
     /** max allowed size(KB) of a single message */
-    @Configured(path = "maximumMessageSize", defaultValue = "0")
-    public long _maximumMessageSize;
+    public long _maximumMessageSize = ApplicationRegistry.getInstance().getConfiguration().getMaximumMessageSize();
 
     /** max allowed number of messages on a queue. */
-    @Configured(path = "maximumMessageCount", defaultValue = "0")
-    public long _maximumMessageCount;
+    public long _maximumMessageCount = ApplicationRegistry.getInstance().getConfiguration().getMaximumMessageCount();
 
     /** max queue depth for the queue */
-    @Configured(path = "maximumQueueDepth", defaultValue = "0")
-    public long _maximumQueueDepth;
+    public long _maximumQueueDepth = ApplicationRegistry.getInstance().getConfiguration().getMaximumQueueDepth();
 
     /** maximum message age before alerts occur */
-    @Configured(path = "maximumMessageAge", defaultValue = "0")
-    public long _maximumMessageAge;
+    public long _maximumMessageAge = ApplicationRegistry.getInstance().getConfiguration().getMaximumMessageAge();
 
-    /** the minimum interval between sending out consequetive alerts of the same type */
-    @Configured(path = "minimumAlertRepeatGap", defaultValue = "0")
-    public long _minimumAlertRepeatGap;
+    /** the minimum interval between sending out consecutive alerts of the same type */
+    public long _minimumAlertRepeatGap = ApplicationRegistry.getInstance().getConfiguration().getMinimumAlertRepeatGap();
 
     private static final int MAX_ASYNC_DELIVERIES = 10;
 
@@ -167,7 +162,7 @@
 
     }
 
-    private void resetNotifications()
+    public void resetNotifications()
     {
         // This ensure that the notification checks for the configured alerts are created.
         setMaximumMessageAge(_maximumMessageAge);
@@ -1590,10 +1585,4 @@
         }
         return ids;
     }
-
-    public void configure(Configuration queueConfiguration)
-    {
-        Configurator.configure(this, queueConfiguration);
-        resetNotifications();
-    }
-}
\ No newline at end of file
+}

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java Thu Feb 19 10:03:18 2009
@@ -20,24 +20,20 @@
  */
 package org.apache.qpid.server.registry;
 
-import org.apache.commons.configuration.Configuration;
+import java.net.InetSocketAddress;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.log4j.Logger;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
+import org.apache.mina.common.IoAcceptor;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
 import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.mina.common.IoAcceptor;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.net.InetSocketAddress;
+import org.apache.qpid.server.security.access.ACLManager;
+import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
+import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
 
 /**
  * An abstract application registry that provides access to configuration information and handles the
@@ -53,7 +49,7 @@
 
     private final Map<Class<?>, Object> _configuredObjects = new HashMap<Class<?>, Object>();
 
-    protected final Configuration _configuration;
+    protected final ServerConfiguration _configuration;
 
     public static final int DEFAULT_INSTANCE = 1;
     public static final String DEFAULT_APPLICATION_REGISTRY = "org.apache.qpid.server.util.NullApplicationRegistry";
@@ -154,7 +150,7 @@
         }
     }
 
-    protected ApplicationRegistry(Configuration configuration)
+    protected ApplicationRegistry(ServerConfiguration configuration)
     {
         _configuration = configuration;
     }
@@ -242,7 +238,7 @@
         }
     }
 
-    public Configuration getConfiguration()
+    public ServerConfiguration getConfiguration()
     {
         return _configuration;
     }
@@ -255,26 +251,6 @@
         }
     }
 
-    public <T> T getConfiguredObject(Class<T> instanceType)
-    {
-        T instance = (T) _configuredObjects.get(instanceType);
-        if (instance == null)
-        {
-            try
-            {
-                instance = instanceType.newInstance();
-            }
-            catch (Exception e)
-            {
-                _logger.error("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor");
-                throw new IllegalArgumentException("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor", e);
-            }
-            Configurator.configure(instance);
-            _configuredObjects.put(instanceType, instance);
-        }
-        return instance;
-    }
-
     public static void setDefaultApplicationRegistry(String clazz)
     {
         _APPLICATION_REGISTRY = clazz;
@@ -287,7 +263,7 @@
 
     public ACLManager getAccessManager()
     {
-        return new ACLManager(_configuration, _pluginManager);
+        return new ACLManager(_configuration.getSecurityConfiguration(), _pluginManager);
     }
 
     public ManagedObjectRegistry getManagedObjectRegistry()

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java Thu Feb 19 10:03:18 2009
@@ -21,71 +21,25 @@
 package org.apache.qpid.server.registry;
 
 import java.io.File;
-import java.util.Collection;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
 
-import org.apache.commons.configuration.CompositeConfiguration;
-import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.SystemConfiguration;
-import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.AMQException;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.management.JMXManagedObjectRegistry;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-import org.apache.qpid.server.management.ManagementConfiguration;
 import org.apache.qpid.server.management.NoopManagedObjectRegistry;
 import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
+import org.apache.qpid.server.security.access.ACLManager;
 import org.apache.qpid.server.security.auth.database.ConfigurationFilePrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
 import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.security.access.ACLPlugin;
-import org.apache.qpid.server.security.access.ACLManager;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.AMQException;
 
 public class ConfigurationFileApplicationRegistry extends ApplicationRegistry
 {
 
     public ConfigurationFileApplicationRegistry(File configurationURL) throws ConfigurationException
     {
-        super(config(configurationURL));
-    }
-
-    // Our configuration class needs to make the interpolate method
-    // public so it can be called below from the config method.
-    private static class MyConfiguration extends CompositeConfiguration
-    {
-        public String interpolate(String obj)
-        {
-            return super.interpolate(obj);
-        }
-    }
-
-    private static final Configuration config(File url) throws ConfigurationException
-    {
-        // We have to override the interpolate methods so that
-        // interpolation takes place accross the entirety of the
-        // composite configuration. Without doing this each
-        // configuration object only interpolates variables defined
-        // inside itself.
-        final MyConfiguration conf = new MyConfiguration();
-        conf.addConfiguration(new SystemConfiguration()
-        {
-            protected String interpolate(String o)
-            {
-                return conf.interpolate(o);
-            }
-        });
-        conf.addConfiguration(new XMLConfiguration(url)
-        {
-            protected String interpolate(String o)
-            {
-                return conf.interpolate(o);
-            }
-        });
-        return conf;
+        super(new ServerConfiguration(configurationURL));
     }
 
     public void initialise() throws Exception
@@ -94,9 +48,9 @@
 
         _virtualHostRegistry = new VirtualHostRegistry();
 
-        _pluginManager = new PluginManager(_configuration.getString("plugin-directory"));
+        _pluginManager = new PluginManager(_configuration.getPluginDirectory());
 
-        _accessManager = new ACLManager(_configuration, _pluginManager);
+        _accessManager = new ACLManager(_configuration.getSecurityConfiguration(), _pluginManager);
         
         _databaseManager = new ConfigurationFilePrincipalDatabaseManager(_configuration);
 
@@ -111,18 +65,17 @@
     }
 
     private void initialiseVirtualHosts() throws Exception
-    {
-        for (String name : getVirtualHostNames())
+    {        
+        for (String name : _configuration.getVirtualHosts())
         {
-
-            _virtualHostRegistry.registerVirtualHost(new VirtualHost(name, getConfiguration().subset("virtualhosts.virtualhost." + name)));
+            _virtualHostRegistry.registerVirtualHost(new VirtualHost(_configuration.getVirtualHostConfig(name)));
         }
+        getVirtualHostRegistry().setDefaultVirtualHostName(_configuration.getDefaultVirtualHost());
     }
 
     private void initialiseManagedObjectRegistry() throws AMQException
     {
-        ManagementConfiguration config = getConfiguredObject(ManagementConfiguration.class);
-        if (config.enabled)
+        if (_configuration.getManagementEnabled())
         {
             _managedObjectRegistry = new JMXManagedObjectRegistry();
         }
@@ -131,10 +84,4 @@
             _managedObjectRegistry = new NoopManagedObjectRegistry();
         }
     }
-
-    public Collection<String> getVirtualHostNames()
-    {
-        return getConfiguration().getList("virtualhosts.virtualhost.name");
-    }
-
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java Thu Feb 19 10:03:18 2009
@@ -24,6 +24,7 @@
 import java.net.InetSocketAddress;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.management.ManagedObjectRegistry;
 import org.apache.qpid.server.plugins.PluginManager;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
@@ -49,21 +50,11 @@
     void close() throws Exception;
 
     /**
-     * This gets access to a "configured object". A configured object has fields populated from a the configuration
-     * object (Commons Configuration) automatically, where it has the appropriate attributes defined on fields.
-     * Application registry implementations can choose the refresh strategy or caching approach.
-     * @param instanceType the type of object you want initialised. This must be unique - i.e. you can only
-     * have a single object of this type in the system.
-     * @return the configured object
-     */
-    <T> T getConfiguredObject(Class<T> instanceType);
-
-    /**
      * Get the low level configuration. For use cases where the configured object approach is not required
      * you can get the complete configuration information.
      * @return a Commons Configuration instance
      */
-    Configuration getConfiguration();
+    ServerConfiguration getConfiguration();
 
     ManagedObjectRegistry getManagedObjectRegistry();
 
@@ -71,8 +62,6 @@
 
     AuthenticationManager getAuthenticationManager();
 
-    Collection<String> getVirtualHostNames();
-
     VirtualHostRegistry getVirtualHostRegistry();
 
     ACLManager getAccessManager();

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/routing/RoutingTable.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/routing/RoutingTable.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/routing/RoutingTable.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/routing/RoutingTable.java Thu Feb 19 10:03:18 2009
@@ -23,6 +23,7 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -41,7 +42,7 @@
      *
      * @throws Exception If any error occurs that means the store is unable to configure itself.
      */
-    void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception;
+    void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception;
 
     /**
      * Called to close and cleanup any resources used by the message store.

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/access/ACLManager.java Thu Feb 19 10:03:18 2009
@@ -30,6 +30,9 @@
 import org.apache.commons.configuration.Configuration;
 import org.apache.log4j.Logger;
 import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.server.configuration.SecurityConfiguration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.plugins.PluginManager;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
@@ -46,12 +49,12 @@
     private Map<String, ACLPlugin> _globalPlugins = new HashMap<String, ACLPlugin>();
     private Map<String, ACLPlugin> _hostPlugins = new HashMap<String, ACLPlugin>();
 
-    public ACLManager(Configuration configuration, PluginManager manager)
+    public ACLManager(SecurityConfiguration configuration, PluginManager manager)
     {
         this(configuration, manager, null);
     }
 
-    public ACLManager(Configuration configuration, PluginManager manager, ACLPluginFactory securityPlugin)
+    public ACLManager(SecurityConfiguration configuration, PluginManager manager, ACLPluginFactory securityPlugin)
     {
         _pluginManager = manager;
 
@@ -70,14 +73,14 @@
     }
 
 
-    public void configureHostPlugins(Configuration hostConfig)
+    public void configureHostPlugins(SecurityConfiguration hostConfig)
     {
         _hostPlugins = configurePlugins(hostConfig);
     }
     
-    public Map<String, ACLPlugin> configurePlugins(Configuration configuration)
+    public Map<String, ACLPlugin> configurePlugins(SecurityConfiguration hostConfig)
     {
-        Configuration securityConfig = configuration.subset("security");
+        Configuration securityConfig = hostConfig.getConfiguration();
         Map<String, ACLPlugin> plugins = new HashMap<String, ACLPlugin>();
         Iterator keys = securityConfig.getKeys();
         Collection<String> handledTags = new HashSet();
@@ -86,7 +89,6 @@
             // Splitting the string is necessary here because of the way that getKeys() returns only
             // bottom level children
             String tag = ((String) keys.next()).split("\\.", 2)[0];
-            
             if (!handledTags.contains(tag))
             {
                 for (ACLPluginFactory plugin : _allSecurityPlugins.values())

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java Thu Feb 19 10:03:18 2009
@@ -34,6 +34,7 @@
 
 import org.apache.qpid.configuration.PropertyUtils;
 import org.apache.qpid.configuration.PropertyException;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
 import org.apache.qpid.server.security.auth.database.PrincipalDatabaseManager;
@@ -46,20 +47,18 @@
 {
     private static final Logger _logger = Logger.getLogger(ConfigurationFilePrincipalDatabaseManager.class);
 
-    private static final String _base = "security.principal-databases.principal-database";
-
     Map<String, PrincipalDatabase> _databases;
 
-    public ConfigurationFilePrincipalDatabaseManager(Configuration configuration) throws Exception
+    public ConfigurationFilePrincipalDatabaseManager(ServerConfiguration _configuration) throws Exception
     {
         _logger.info("Initialising PrincipleDatabase authentication manager");
-        _databases = initialisePrincipalDatabases(configuration);
+        _databases = initialisePrincipalDatabases(_configuration);
     }
 
-    private Map<String, PrincipalDatabase> initialisePrincipalDatabases(Configuration configuration) throws Exception
+    private Map<String, PrincipalDatabase> initialisePrincipalDatabases(ServerConfiguration _configuration) throws Exception
     {
-        List<String> databaseNames = configuration.getList(_base + ".name");
-        List<String> databaseClasses = configuration.getList(_base + ".class");
+        List<String> databaseNames = _configuration.getPrincipalDatabaseNames();
+        List<String> databaseClasses = _configuration.getPrincipalDatabaseClass();
         Map<String, PrincipalDatabase> databases = new HashMap<String, PrincipalDatabase>();
 
         if (databaseNames.size() == 0)
@@ -84,7 +83,7 @@
                 throw new Exception("Principal databases must implement the PrincipalDatabase interface");
             }
 
-            initialisePrincipalDatabase((PrincipalDatabase) o, configuration, i);
+            initialisePrincipalDatabase((PrincipalDatabase) o, _configuration, i);
 
             String name = databaseNames.get(i);
             if ((name == null) || (name.length() == 0))
@@ -105,12 +104,11 @@
         return databases;
     }
 
-    private void initialisePrincipalDatabase(PrincipalDatabase principalDatabase, Configuration config, int index)
+    private void initialisePrincipalDatabase(PrincipalDatabase principalDatabase, ServerConfiguration _configuration, int index)
             throws FileNotFoundException, ConfigurationException
     {
-        String baseName = _base + "(" + index + ").attributes.attribute.";
-        List<String> argumentNames = config.getList(baseName + "name");
-        List<String> argumentValues = config.getList(baseName + "value");
+        List<String> argumentNames = _configuration.getPrincipalDatabaseAttributeNames(index);
+        List<String> argumentValues = _configuration.getPrincipalDatabaseAttributeValues(index);
         for (int i = 0; i < argumentNames.size(); i++)
         {
             String argName = argumentNames.get(i);
@@ -166,18 +164,17 @@
         return _databases;
     }
 
-    public void initialiseManagement(Configuration config) throws ConfigurationException
+    public void initialiseManagement(ServerConfiguration config) throws ConfigurationException
     {
         try
         {
             AMQUserManagementMBean _mbean = new AMQUserManagementMBean();
 
-            String baseSecurity = "security.jmx";
-            List<String> principalDBs = config.getList(baseSecurity + ".principal-database");
+            List<String> principalDBs = config.getManagementPrincipalDBs();
 
             if (principalDBs.size() == 0)
             {
-                throw new ConfigurationException("No principal-database specified for jmx security(" + baseSecurity + ".principal-database)");
+                throw new ConfigurationException("No principal-database specified for jmx security");
             }
 
             String databaseName = principalDBs.get(0);
@@ -191,11 +188,11 @@
 
             _mbean.setPrincipalDatabase(database);
 
-            List<String> jmxaccesslist = config.getList(baseSecurity + ".access");
+            List<String> jmxaccesslist = config.getManagementAccessList();
 
             if (jmxaccesslist.size() == 0)
             {
-                throw new ConfigurationException("No access control files specified for jmx security(" + baseSecurity + ".access)");
+                throw new ConfigurationException("No access control files specified for jmx security");
             }
 
             String jmxaccesssFile = null;

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java Thu Feb 19 10:03:18 2009
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.server.security.auth.database;
 
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
@@ -30,5 +31,5 @@
 {
     public Map<String, PrincipalDatabase> getDatabases();
 
-    public void initialiseManagement(Configuration config) throws ConfigurationException;
+    public void initialiseManagement(ServerConfiguration _configuration) throws ConfigurationException;
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java Thu Feb 19 10:03:18 2009
@@ -20,7 +20,8 @@
  */
 package org.apache.qpid.server.security.auth.database;
 
-import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 
 import java.util.Map;
 import java.util.Properties;
@@ -41,7 +42,8 @@
         return _databases;
     }
 
-    public void initialiseManagement(Configuration config)
+    @Override
+    public void initialiseManagement(ServerConfiguration _configuration) throws ConfigurationException
     {
         //todo
     }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java Thu Feb 19 10:03:18 2009
@@ -23,6 +23,7 @@
 import org.apache.log4j.Logger;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.ConfigurationException;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
 import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
@@ -60,7 +61,7 @@
     /** The name for the required SASL Server mechanisms */
     public static final String PROVIDER_NAME= "AMQSASLProvider-Server";
 
-    public PrincipalDatabaseAuthenticationManager(String name, Configuration hostConfig) throws Exception
+    public PrincipalDatabaseAuthenticationManager(String name, VirtualHostConfiguration hostConfig) throws Exception
     {
         _logger.info("Initialising " + (name == null ? "Default" : "'" + name + "'")
                      + " PrincipleDatabase authentication manager.");
@@ -77,7 +78,7 @@
         }
         else
         {
-            String databaseName = hostConfig.getString("security.authentication.name");
+            String databaseName = hostConfig.getAuthenticationDatabase();
 
             if (databaseName == null)
             {
@@ -121,14 +122,6 @@
 
     private void initialiseAuthenticationMechanisms(Map<String, Class<? extends SaslServerFactory>> providerMap, Map<String, PrincipalDatabase> databases) throws Exception
     {
-//        Configuration config = ApplicationRegistry.getInstance().getConfiguration();
-//        List<String> mechanisms = config.getList("security.sasl.mechanisms.mechanism.initialiser.class");
-//
-//        // Maps from the mechanism to the properties used to initialise the server. See the method
-//        // Sasl.createSaslServer for details of the use of these properties. This map is populated during initialisation
-//        // of each provider.
-
-
         if (databases.size() > 1)
         {
             _logger.warn("More than one principle database provided currently authentication mechanism will override each other.");
@@ -136,13 +129,11 @@
 
         for (Map.Entry<String, PrincipalDatabase> entry : databases.entrySet())
         {
-
             // fixme As the database now provide the mechanisms they support, they will ...
             // overwrite each other in the map. There should only be one database per vhost.
             // But currently we must have authentication before vhost definition.
             initialiseAuthenticationMechanisms(providerMap, entry.getValue());
         }
-
     }
 
     private void initialiseAuthenticationMechanisms(Map<String, Class<? extends SaslServerFactory>> providerMap, PrincipalDatabase database) throws Exception

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java Thu Feb 19 10:03:18 2009
@@ -21,6 +21,7 @@
 package org.apache.qpid.server.store;
 
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
@@ -142,7 +143,7 @@
     private State _state = State.INITIAL;
 
 
-    public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
+    public void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception
     {
         //Only initialise when loaded with the old 'store' confing ignore the new 'RoutingTable' config
         if (base.equals("store"))
@@ -156,7 +157,7 @@
             _logger.info("Configuring Derby message store for virtual host " + virtualHost.getName());
             QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
 
-            final String databasePath = config.getString(base + "." + ENVIRONMENT_PATH_PROPERTY, "derbyDB");
+            final String databasePath = config.getStoreConfiguration().getString(base + "." + ENVIRONMENT_PATH_PROPERTY, "derbyDB");
 
             File environmentPath = new File(databasePath);
             if (!environmentPath.exists())

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java Thu Feb 19 10:03:18 2009
@@ -27,6 +27,7 @@
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.ContentChunk;
 import org.apache.qpid.server.queue.MessageMetaData;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -70,19 +71,19 @@
         _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>(DEFAULT_HASHTABLE_CAPACITY);
     }
 
-    public void configure(String base, Configuration config)
+    public void configure(String base, VirtualHostConfiguration config)
     {
         //Only initialise when called with current 'store' configs i.e. don't reinit when used as a 'RoutingTable'
         if (base.equals("store"))
         {
-            int hashtableCapacity = config.getInt(base + "." + HASHTABLE_CAPACITY_CONFIG, DEFAULT_HASHTABLE_CAPACITY);
+            int hashtableCapacity = config.getStoreConfiguration().getInt(base + "." + HASHTABLE_CAPACITY_CONFIG, DEFAULT_HASHTABLE_CAPACITY);
             _log.info("Using capacity " + hashtableCapacity + " for hash tables");
             _metaDataMap = new ConcurrentHashMap<Long, MessageMetaData>(hashtableCapacity);
             _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>(hashtableCapacity);
         }
     }
 
-    public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
+    public void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception
     {
         configure(base, config);
     }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transactionlog/TransactionLog.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transactionlog/TransactionLog.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transactionlog/TransactionLog.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transactionlog/TransactionLog.java Thu Feb 19 10:03:18 2009
@@ -26,6 +26,7 @@
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.ContentChunk;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.MessageMetaData;
 import org.apache.qpid.server.queue.AMQQueue;
@@ -67,7 +68,7 @@
      *
      * @throws Exception If any error occurs that means the store is unable to configure itself.
      */
-    void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception;
+    void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception;
 
     /**
      * Called to close and cleanup any resources used by the message store.

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java Thu Feb 19 10:03:18 2009
@@ -26,7 +26,11 @@
 import java.util.Properties;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.MapConfiguration;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.management.NoopManagedObjectRegistry;
 import org.apache.qpid.server.plugins.PluginManager;
 import org.apache.qpid.server.registry.ApplicationRegistry;
@@ -39,17 +43,16 @@
 
 public class NullApplicationRegistry extends ApplicationRegistry
 {
-    public NullApplicationRegistry()
+    public NullApplicationRegistry() throws ConfigurationException
     {
-        super(new MapConfiguration(new HashMap()));
+        super(new ServerConfiguration(new PropertiesConfiguration()));
     }
 
     public void initialise() throws Exception
     {
         _logger.info("Initialising NullApplicationRegistry");
         
-        _configuration.addProperty("store.class", "org.apache.qpid.server.store.MemoryMessageStore");
-        _configuration.addProperty("housekeeping.expiredMessageCheckPeriod", "200");
+        _configuration.setHousekeepingExpiredMessageCheckPeriod(200);
         
         Properties users = new Properties();
 
@@ -57,17 +60,18 @@
 
         _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
 
-        _accessManager = new ACLManager(_configuration, _pluginManager, AllowAll.FACTORY);
+        _accessManager = new ACLManager(_configuration.getSecurityConfiguration(), _pluginManager, AllowAll.FACTORY);
 
         _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
 
         _managedObjectRegistry = new NoopManagedObjectRegistry();
         _virtualHostRegistry = new VirtualHostRegistry();
-        VirtualHost dummyHost = new VirtualHost("test", _configuration);
+        PropertiesConfiguration vhostProps = new PropertiesConfiguration();
+        VirtualHostConfiguration hostConfig = new VirtualHostConfiguration("test", vhostProps);
+        VirtualHost dummyHost = new VirtualHost(hostConfig);
         _virtualHostRegistry.registerVirtualHost(dummyHost);
         _virtualHostRegistry.setDefaultVirtualHostName("test");
         _pluginManager = new PluginManager("");
-        _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
 
     }
 

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Thu Feb 19 10:03:18 2009
@@ -20,35 +20,41 @@
  */
 package org.apache.qpid.server.virtualhost;
 
+import java.util.Collections;
+import java.util.List;
 import java.util.Timer;
 import java.util.TimerTask;
 
 import javax.management.NotCompliantMBeanException;
 
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.AMQBrokerManagerMBean;
-import org.apache.qpid.server.routing.RoutingTable;
-import org.apache.qpid.server.transactionlog.TransactionLog;
-import org.apache.qpid.server.configuration.Configurator;
+import org.apache.qpid.server.configuration.ExchangeConfiguration;
+import org.apache.qpid.server.configuration.QueueConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.connection.ConnectionRegistry;
 import org.apache.qpid.server.connection.IConnectionRegistry;
 import org.apache.qpid.server.exchange.DefaultExchangeFactory;
 import org.apache.qpid.server.exchange.DefaultExchangeRegistry;
+import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.exchange.ExchangeFactory;
 import org.apache.qpid.server.exchange.ExchangeRegistry;
 import org.apache.qpid.server.management.AMQManagedObject;
 import org.apache.qpid.server.management.ManagedObject;
 import org.apache.qpid.server.queue.AMQQueue;
+import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.server.queue.DefaultQueueRegistry;
 import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.registry.ApplicationRegistry;
+import org.apache.qpid.server.routing.RoutingTable;
 import org.apache.qpid.server.security.access.ACLManager;
 import org.apache.qpid.server.security.access.Accessable;
 import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
 import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
+import org.apache.qpid.server.transactionlog.TransactionLog;
 
 public class VirtualHost implements Accessable
 {
@@ -79,9 +85,6 @@
 
     private final Timer _houseKeepingTimer;
      
-    private static final long DEFAULT_HOUSEKEEPING_PERIOD = 30000L;
-
-
     public void setAccessableName(String name)
     {
         _logger.warn("Setting Accessable Name for VirualHost is not allowed. ("
@@ -133,46 +136,31 @@
     } // End of MBean class
 
     /**
-     * Used for testing only
-     * @param name
-     * @param transactionLog
-     * @throws Exception
-     */
-    public VirtualHost(String name, TransactionLog transactionLog) throws Exception
-    {
-        this(name, new PropertiesConfiguration(), transactionLog);
-    }
-
-    /**
      * Normal Constructor
      * @param name
      * @param hostConfig
      * @throws Exception
      */
-    public VirtualHost(String name, Configuration hostConfig) throws Exception
+    public VirtualHost(VirtualHostConfiguration hostConfig) throws Exception
     {
-        this(name, hostConfig, null);
+        this(hostConfig, null);
     }
 
-    public VirtualHost(String name, Configuration hostConfig, TransactionLog transactionLog) throws Exception
+    public VirtualHost(VirtualHostConfiguration hostConfig, TransactionLog transactionLog) throws Exception
     {
-        if (name == null || name.length() == 0)
+        _name = hostConfig.getName();
+        
+        if (_name == null || _name.length() == 0)
         {
-            throw new IllegalArgumentException("Illegal name (" + name + ") for virtualhost.");
+            throw new IllegalArgumentException("Illegal name (" + _name + ") for virtualhost.");
         }
 
-        _name = name;
-
         _virtualHostMBean = new VirtualHostMBean();
 
         _connectionRegistry = new ConnectionRegistry(this);
 
-        _houseKeepingTimer = new Timer("Queue-housekeeping-"+name, true);
-        _queueRegistry = new DefaultQueueRegistry(this);
-        _exchangeFactory = new DefaultExchangeFactory(this);
-        _exchangeFactory.initialise(hostConfig);
-        _exchangeRegistry = new DefaultExchangeRegistry(this);
-
+        _houseKeepingTimer = new Timer("Queue-housekeeping-"+_name, true);
+        
         if (transactionLog != null)
         {
             _transactionLog = transactionLog;
@@ -183,33 +171,30 @@
         }
         else
         {
-            if (hostConfig == null)
-            {
-                throw new IllegalAccessException("HostConfig and TransactionLog cannot be null");
-            }
             initialiseTransactionLog(hostConfig);
             initialiseRoutingTable(hostConfig);
         }
 
-
-
+        _queueRegistry = new DefaultQueueRegistry(this);
+        _exchangeFactory = new DefaultExchangeFactory(this);
+        _exchangeFactory.initialise(hostConfig);
+        _exchangeRegistry = new DefaultExchangeRegistry(this);
         _exchangeRegistry.initialise();
 
-        _authenticationManager = new PrincipalDatabaseAuthenticationManager(name, hostConfig);
+        initialiseModel(hostConfig);
+        
+        _authenticationManager = new PrincipalDatabaseAuthenticationManager(_name, hostConfig);
 
         _accessManager = ApplicationRegistry.getInstance().getAccessManager();
-        _accessManager.configureHostPlugins(hostConfig);
+        _accessManager.configureHostPlugins(hostConfig.getSecurityConfiguration());
         
         _brokerMBean = new AMQBrokerManagerMBean(_virtualHostMBean);
         _brokerMBean.register();
-        initialiseHouseKeeping(hostConfig);
+        initialiseHouseKeeping(hostConfig.getHousekeepingExpiredMessageCheckPeriod());
     }
 
-    private void initialiseHouseKeeping(final Configuration hostConfig)
+    private void initialiseHouseKeeping(long period)
     {
-     
-        long period = hostConfig.getLong("housekeeping.expiredMessageCheckPeriod", DEFAULT_HOUSEKEEPING_PERIOD);
-    
         /* add a timer task to iterate over queues, cleaning expired messages from queues with no consumers */
         if(period != 0L)
         {
@@ -240,9 +225,9 @@
     }
 
     //todo we need to move from store.class to transactionlog.class
-    private void initialiseTransactionLog(Configuration config) throws Exception
+    private void initialiseTransactionLog(VirtualHostConfiguration config) throws Exception
     {
-        String transactionLogClass = config.getString("store.class");
+        String transactionLogClass = config.getTransactionLogClass();
 
         Class clazz = Class.forName(transactionLogClass);
         Object o = clazz.newInstance();
@@ -257,9 +242,9 @@
     }
 
     //todo we need to move from store.class to transactionlog.class
-    private void initialiseRoutingTable(Configuration config) throws Exception
+    private void initialiseRoutingTable(VirtualHostConfiguration hostConfig) throws Exception
     {
-        String transactionLogClass = config.getString("routingtable.class");
+        String transactionLogClass = hostConfig.getRoutingTableClass();
 
         if (transactionLogClass != null)
         {
@@ -272,7 +257,7 @@
                                              " does not.");
             }
             _routingTable = (RoutingTable) o;
-            _routingTable.configure(this, "routingtable", config);
+            _routingTable.configure(this, "routingtable", hostConfig);
         }
         else
         {
@@ -282,24 +267,86 @@
             }
         }
     }
+    
+    private void initialiseModel(VirtualHostConfiguration config) throws ConfigurationException, AMQException
+    {
+        _logger.debug("Loading configuration for virtualhost: "+config.getName());
+
+        List exchangeNames = config.getExchanges();
+
+        for(Object exchangeNameObj : exchangeNames)
+        {
+            String exchangeName = String.valueOf(exchangeNameObj);
+            configureExchange(config.getExchangeConfiguration(exchangeName));
+        }
+
+        String[] queueNames = config.getQueueNames();
+
+        for(Object queueNameObj : queueNames)
+        {
+            String queueName = String.valueOf(queueNameObj);
+            configureQueue(config.getQueueConfiguration(queueName));
+        }
+    }
+
+    private void configureExchange(ExchangeConfiguration exchangeConfiguration) throws AMQException
+    {
+        AMQShortString exchangeName = new AMQShortString(exchangeConfiguration.getName());
+
+        Exchange exchange;
+        exchange = _exchangeRegistry.getExchange(exchangeName);
+        if(exchange == null)
+        {
 
+            AMQShortString type = new AMQShortString(exchangeConfiguration.getType());
+            boolean durable = exchangeConfiguration.getDurable();
+            boolean autodelete = exchangeConfiguration.getAutoDelete();
 
+            Exchange newExchange = _exchangeFactory.createExchange(exchangeName,type,durable,autodelete,0);
+            _exchangeRegistry.registerExchange(newExchange);
+        }
+    }
 
-    public <T> T getConfiguredObject(Class<T> instanceType, Configuration config)
+    private void configureQueue(QueueConfiguration queueConfiguration) throws AMQException, ConfigurationException
     {
-        T instance;
-        try
+        AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(queueConfiguration, this);
+
+        if (queue.isDurable())
+        {
+            _routingTable.createQueue(queue);
+        }
+
+        String exchangeName = queueConfiguration.getExchange();
+
+        Exchange exchange = _exchangeRegistry.getExchange(exchangeName == null ? null : new AMQShortString(exchangeName));
+
+        if(exchange == null)
+        {
+            exchange = _exchangeRegistry.getDefaultExchange();
+        }
+
+        if (exchange == null)
+        {
+            throw new ConfigurationException("Attempt to bind queue to unknown exchange:" + exchangeName);
+        }
+
+        List routingKeys = queueConfiguration.getRoutingKeys();
+        if(routingKeys == null || routingKeys.isEmpty())
         {
-            instance = instanceType.newInstance();
+            routingKeys = Collections.singletonList(queue.getName());
         }
-        catch (Exception e)
+
+        for(Object routingKeyNameObj : routingKeys)
         {
-            _logger.error("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor");
-            throw new IllegalArgumentException("Unable to instantiate configuration class " + instanceType + " - ensure it has a public default constructor", e);
+            AMQShortString routingKey = new AMQShortString(String.valueOf(routingKeyNameObj));
+            queue.bind(exchange, routingKey, null);
+            _logger.info("Queue '" + queue.getName() + "' bound to exchange:" + exchangeName + " RK:'" + routingKey + "'");
         }
-        Configurator.configure(instance);
 
-        return instance;
+        if(exchange != _exchangeRegistry.getDefaultExchange())
+        {
+            queue.bind(_exchangeRegistry.getDefaultExchange(), queue.getName(), null);
+        }
     }
 
     public String getName()

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java Thu Feb 19 10:03:18 2009
@@ -21,12 +21,15 @@
 package org.apache.qpid.server.ack;
 
 import junit.framework.TestCase;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.ContentHeaderBody;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.server.RequiredDeliveryException;
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.queue.AMQMessage;
 import org.apache.qpid.server.queue.MessageFactory;
 import org.apache.qpid.server.queue.QueueEntry;
@@ -121,8 +124,13 @@
                                                                           _storeContext, null,
                                                                           new LinkedList<RequiredDeliveryException>()
             );
-            _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false, new VirtualHost("test", new MemoryMessageStore()),
-			                                   null);
+
+            PropertiesConfiguration env = new PropertiesConfiguration();
+            env.setProperty("name", "test");
+            VirtualHost virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env));
+            
+            _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false,
+                    virtualHost, null);
 
             for (int i = 0; i < messageCount; i++)
             {

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java Thu Feb 19 10:03:18 2009
@@ -20,13 +20,10 @@
 package org.apache.qpid.server.configuration;
 
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
+import junit.framework.TestCase;
 
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.XMLConfiguration;
-import org.apache.commons.configuration.HierarchicalConfiguration.Node;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.server.queue.AMQPriorityQueue;
@@ -34,29 +31,22 @@
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.virtualhost.VirtualHost;
 
-import junit.framework.TestCase;
-
 public class VirtualHostConfigurationTest extends TestCase
 {
 
-    private File configFile;
     private VirtualHostConfiguration vhostConfig;
     private XMLConfiguration  configXml;
 
     @Override
     protected void setUp() throws Exception
-    {
-        // Create temporary configuration file
-        configFile = File.createTempFile(this.getName()+"config", ".xml");
-        configFile.deleteOnExit();
-        
+    {   
         // Fill config file with stuff
         configXml = new XMLConfiguration();
         configXml.setRootElementName("virtualhosts");
         configXml.addProperty("virtualhost(-1).name", "test");
     }
     
-    public void testQueuePriority() throws ConfigurationException, AMQException
+    public void testQueuePriority() throws Exception
     {
         // Set up queue with 5 priorities
         configXml.addProperty("virtualhost.test.queues(-1).queue(-1).name(-1)", 
@@ -81,14 +71,8 @@
                               "amq.direct");
         configXml.addProperty("virtualhost.test.queues.queue.ntest.priority", 
                               "false");
-        configXml.save(configFile);
-        
-        // Setup virtual host configuration
-        vhostConfig = new VirtualHostConfiguration(configFile.getAbsolutePath());
         
-        // Do bindings and get resulting vhost
-        vhostConfig.performBindings();
-        VirtualHost vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test");
+        VirtualHost vhost = new VirtualHost(new VirtualHostConfiguration("test", configXml.subset("virtualhost.test")));
         
         // Check that atest was a priority queue with 5 priorities
         AMQQueue atest = vhost.getQueueRegistry().getQueue(new AMQShortString("atest"));
@@ -105,4 +89,36 @@
         assertFalse(ntest instanceof AMQPriorityQueue);
     }
     
+    public void testQueueAlerts() throws Exception
+    {
+        // Set up queue with 5 priorities
+        configXml.addProperty("virtualhost.test.queues.exchange", "amq.topic");
+        configXml.addProperty("virtualhost.test.queues.maximumQueueDepth", "1");
+        configXml.addProperty("virtualhost.test.queues.maximumMessageSize", "2");
+        configXml.addProperty("virtualhost.test.queues.maximumMessageAge", "3");
+        
+        configXml.addProperty("virtualhost.test.queues(-1).queue(1).name(1)", "atest");
+        configXml.addProperty("virtualhost.test.queues.queue.atest(-1).exchange", "amq.direct");
+        configXml.addProperty("virtualhost.test.queues.queue.atest(-1).maximumQueueDepth", "4");
+        configXml.addProperty("virtualhost.test.queues.queue.atest(-1).maximumMessageSize", "5");
+        configXml.addProperty("virtualhost.test.queues.queue.atest(-1).maximumMessageAge", "6");
+
+        configXml.addProperty("virtualhost.test.queues(-1).queue(-1).name(-1)", "btest");
+        
+        VirtualHost vhost = new VirtualHost(new VirtualHostConfiguration("test", configXml.subset("virtualhost.test")));
+        
+        // Check specifically configured values
+        AMQQueue aTest = vhost.getQueueRegistry().getQueue(new AMQShortString("atest"));
+        assertEquals(4, aTest.getMaximumQueueDepth());
+        assertEquals(5, aTest.getMaximumMessageSize());
+        assertEquals(6, aTest.getMaximumMessageAge());
+        
+        // Check default values        
+        AMQQueue bTest = vhost.getQueueRegistry().getQueue(new AMQShortString("btest"));
+        assertEquals(1, bTest.getMaximumQueueDepth());
+        assertEquals(2, bTest.getMaximumMessageSize());
+        assertEquals(3, bTest.getMaximumMessageAge());
+        
+    }
+    
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java Thu Feb 19 10:03:18 2009
@@ -34,6 +34,7 @@
 import org.apache.qpid.server.transactionlog.TransactionLog;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.subscription.SubscriptionFactoryImpl;
+import org.apache.qpid.server.configuration.QueueConfiguration;
 import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
 import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.framing.ContentHeaderBody;
@@ -250,26 +251,6 @@
         _queueMBean.clearQueue();
         assertEquals(new Long(0), new Long(_queueMBean.getQueueDepth()));
     }
-
-    public void testAlertConfiguration() throws AMQException
-    {
-        // Setup configuration
-        CompositeConfiguration config = new CompositeConfiguration();
-        config.setProperty("maximumMessageSize", new Long(23));
-        config.setProperty("maximumMessageCount", new Long(24));
-        config.setProperty("maximumQueueDepth", new Long(25));
-        config.setProperty("maximumMessageAge", new Long(26));
-
-        // Create queue and set config
-        _queue = getNewQueue();
-        _queue.configure(config);
-
-        // Check alerts and notifications
-        Set<NotificationCheck> checks = _queue.getNotificationChecks();
-        assertNotNull("No checks found", checks);
-        assertFalse("Checks should not be empty", checks.isEmpty());
-        assertEquals("Wrong number of checks", 4, checks.size());
-    }
     
     protected IncomingMessage message(final boolean immediate, long size) throws AMQException
     {

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java Thu Feb 19 10:03:18 2009
@@ -23,6 +23,7 @@
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.configuration.QueueConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.subscription.Subscription;
 import org.apache.qpid.server.store.StoreContext;
@@ -301,11 +302,6 @@
         //To change body of implemented methods use File | Settings | File Templates.
     }
 
-    public void configure(Configuration virtualHostDefaultQueueConfiguration)
-    {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-
     public ManagedObject getManagedObject()
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
@@ -315,4 +311,11 @@
     {
         return 0;  //To change body of implemented methods use File | Settings | File Templates.
     }
+
+    @Override
+    public void setMinimumAlertRepeatGap(long value)
+    {
+        
+    }
+
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java Thu Feb 19 10:03:18 2009
@@ -21,6 +21,9 @@
  */
 
 import junit.framework.TestCase;
+
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.BasicContentHeaderProperties;
@@ -28,6 +31,7 @@
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.DirectExchange;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.store.StoreContext;
@@ -63,7 +67,8 @@
         //Create Application Registry for test
         ApplicationRegistry applicationRegistry = (ApplicationRegistry) ApplicationRegistry.getInstance(1);
 
-        _virtualHost = new VirtualHost("vhost", _store);
+        PropertiesConfiguration env = new PropertiesConfiguration();
+        _virtualHost = new VirtualHost(new VirtualHostConfiguration(getClass().getName(), env), _store);
         applicationRegistry.getVirtualHostRegistry().registerVirtualHost(_virtualHost);
 
         _queue = (SimpleAMQQueue) AMQQueueFactory.createAMQQueueImpl(_qname, false, _owner, false, _virtualHost, _arguments);

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java Thu Feb 19 10:03:18 2009
@@ -39,7 +39,7 @@
 
     ApplicationRegistry _registry;
 
-    public void setUp()
+    public void setUp() throws Exception
     {
         _registry = new TestApplicationRegistry();
     }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java Thu Feb 19 10:03:18 2009
@@ -29,6 +29,8 @@
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.commons.configuration.XMLConfiguration;
+import org.apache.qpid.server.configuration.SecurityConfiguration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.plugins.MockPluginManager;
 import org.apache.qpid.server.plugins.PluginManager;
@@ -43,7 +45,7 @@
 
     private ACLManager _authzManager;
     private AMQProtocolSession _session;
-    private XMLConfiguration _conf;
+    private SecurityConfiguration _conf;
     private PluginManager _pluginManager;
 
     @Override
@@ -52,10 +54,10 @@
         File tmpFile = File.createTempFile(getClass().getName(), "testconfig");
         tmpFile.deleteOnExit();
         BufferedWriter out = new BufferedWriter(new FileWriter(tmpFile));
-        out.write("<broker><security><queueDenier>notyet</queueDenier><exchangeDenier>yes</exchangeDenier></security></broker>");
+        out.write("<security><queueDenier>notyet</queueDenier><exchangeDenier>yes</exchangeDenier></security>");
         out.close();
         
-        _conf = new XMLConfiguration(tmpFile);
+        _conf = new SecurityConfiguration(new XMLConfiguration(tmpFile));
         
         // Create ACLManager
         
@@ -88,10 +90,9 @@
     public void testConfigurePlugins()
     {
         Configuration hostConfig = new PropertiesConfiguration();
-        hostConfig.setProperty("security.queueDenier", "thisoneneither");
-        _authzManager.configureHostPlugins(hostConfig);
+        hostConfig.setProperty("queueDenier", "thisoneneither");
+        _authzManager.configureHostPlugins(new SecurityConfiguration(hostConfig));
         AMQQueue queue = new MockAMQQueue("thisoneneither");
         assertFalse(_authzManager.authoriseDelete(_session, queue));
     }
-
 }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java Thu Feb 19 10:03:18 2009
@@ -23,11 +23,13 @@
 
 import junit.framework.TestCase;
 
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.amqp_0_9.ExchangeDeclareBodyImpl;
 import org.apache.qpid.framing.amqp_0_9.QueueDeclareBodyImpl;
 import org.apache.qpid.framing.amqp_8_0.QueueBindBodyImpl;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.DirectExchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
@@ -50,7 +52,6 @@
     private boolean _nowait = false;
     private boolean _passive = false;
     private boolean _durable = false;
-    private boolean _exclusive = false;
     private boolean _autoDelete = false;
     private AMQShortString _exchangeType = new AMQShortString("direct");
     private boolean _internal = false;
@@ -67,7 +68,8 @@
         _perms = new PrincipalPermissions(_user);
         try 
         {
-            _virtualHost = new VirtualHost("localhost", new SkeletonMessageStore());
+            PropertiesConfiguration env = new PropertiesConfiguration();
+            _virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env));
             _exchange = DirectExchange.TYPE.newInstance(_virtualHost, _exchangeName, _durable, _ticket, _autoDelete);
             _queue = AMQQueueFactory.createAMQQueueImpl(_queueName, false, _owner , false, _virtualHost, _arguments);
         } 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java Thu Feb 19 10:03:18 2009
@@ -30,8 +30,10 @@
 import junit.framework.TestCase;
 
 import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.commons.configuration.XMLConfiguration;
 import org.apache.qpid.codec.AMQCodecFactory;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
 import org.apache.qpid.server.protocol.TestIoSession;
 import org.apache.qpid.server.security.access.ACLPlugin.AuthzResult;
@@ -87,7 +89,8 @@
     public void setUp() throws Exception
     {
         _store = new TestableMemoryMessageStore();
-        _virtualHost = new VirtualHost("vhost", _store);
+        PropertiesConfiguration env = new PropertiesConfiguration();
+        _virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env));
         TestIoSession iosession = new TestIoSession();
         iosession.setAddress("127.0.0.1");
         VirtualHostRegistry virtualHostRegistry = null;

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java Thu Feb 19 10:03:18 2009
@@ -21,6 +21,8 @@
 package org.apache.qpid.server.store;
 
 import junit.framework.TestCase;
+
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.DirectExchange;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.exchange.ExchangeType;
@@ -102,7 +104,7 @@
 
         try
         {
-            _virtualHost = new VirtualHost(virtualHostName, configuration, null);
+            _virtualHost = new VirtualHost(new VirtualHostConfiguration(getClass().getName(), configuration));
             ApplicationRegistry.getInstance().getVirtualHostRegistry().registerVirtualHost(_virtualHost);
         }
         catch (Exception e)

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java Thu Feb 19 10:03:18 2009
@@ -28,6 +28,7 @@
 import org.apache.qpid.server.queue.MessageMetaData;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.transactionlog.TransactionLog;
 import org.apache.qpid.server.routing.RoutingTable;
@@ -47,7 +48,7 @@
     {
     }
     
-    public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
+    public void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception
     {
         //To change body of implemented methods use File | Settings | File Templates.
     }

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java Thu Feb 19 10:03:18 2009
@@ -21,11 +21,14 @@
 package org.apache.qpid.server.util;
 
 import junit.framework.TestCase;
+
+import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.IApplicationRegistry;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.AMQQueueFactory;
 import org.apache.qpid.framing.abstraction.MessagePublishInfoImpl;
+import org.apache.qpid.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.server.AMQChannel;
@@ -58,7 +61,9 @@
     public void setUp() throws Exception
     {
         super.setUp();
-        _registry = new TestApplicationRegistry();
+        PropertiesConfiguration configuration = new PropertiesConfiguration();
+        configuration.setProperty("virtualhosts.virtualhost.test.store.class", TestableMemoryMessageStore.class.getName());
+        _registry = new TestApplicationRegistry(new ServerConfiguration(configuration));
         ApplicationRegistry.initialise(_registry);
         _virtualHost = _registry.getVirtualHostRegistry().getVirtualHost("test");        
 

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java Thu Feb 19 10:03:18 2009
@@ -20,7 +20,11 @@
  */
 package org.apache.qpid.server.util;
 
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.configuration.MapConfiguration;
+import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.qpid.server.configuration.ServerConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.ExchangeFactory;
 import org.apache.qpid.server.exchange.ExchangeRegistry;
 import org.apache.qpid.server.management.NoopManagedObjectRegistry;
@@ -52,9 +56,17 @@
 
     private VirtualHost _vHost;
 
-    public TestApplicationRegistry()
+    private ServerConfiguration _config;
+
+    public TestApplicationRegistry() throws ConfigurationException
+    {
+        super(new ServerConfiguration(new PropertiesConfiguration()));
+    }
+    
+    public TestApplicationRegistry(ServerConfiguration config) throws ConfigurationException
     {
-        super(new MapConfiguration(new HashMap()));
+        super(config);
+        _config = config;
     }
 
     public void initialise() throws Exception
@@ -65,7 +77,7 @@
 
         _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
 
-        _accessManager = new ACLManager(_configuration, _pluginManager, AllowAll.FACTORY);
+        _accessManager = new ACLManager(_configuration.getSecurityConfiguration(), _pluginManager, AllowAll.FACTORY);
 
         _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
 
@@ -75,7 +87,9 @@
 
         _virtualHostRegistry = new VirtualHostRegistry();
 
-        _vHost = new VirtualHost("test", _transactionLog);
+        PropertiesConfiguration vhostProps = new PropertiesConfiguration();
+        VirtualHostConfiguration hostConfig = new VirtualHostConfiguration("test", vhostProps);
+        _vHost = new VirtualHost(hostConfig, _transactionLog);
 
         _virtualHostRegistry.registerVirtualHost(_vHost);
 
@@ -83,7 +97,6 @@
         _exchangeFactory = _vHost.getExchangeFactory();
         _exchangeRegistry = _vHost.getExchangeRegistry();
 
-        _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
     }
 
     public QueueRegistry getQueueRegistry()

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualhostInitRoutingTableFromTransactionLogTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualhostInitRoutingTableFromTransactionLogTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualhostInitRoutingTableFromTransactionLogTest.java (original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/VirtualhostInitRoutingTableFromTransactionLogTest.java Thu Feb 19 10:03:18 2009
@@ -22,6 +22,7 @@
 
 import junit.framework.TestCase;
 import org.apache.commons.configuration.PropertiesConfiguration;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 
 public class VirtualhostInitRoutingTableFromTransactionLogTest extends TestCase
 {
@@ -35,7 +36,7 @@
         VirtualHost _virtualHost = null;
         try
         {
-            _virtualHost = new VirtualHost("test", env);
+            _virtualHost = new VirtualHost(new VirtualHostConfiguration("test", env));
 
             assertNotNull(_virtualHost.getTransactionLog());
             assertNotNull(_virtualHost.getRoutingTable());

Modified: qpid/trunk/qpid/java/systests/build.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/build.xml?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/build.xml (original)
+++ qpid/trunk/qpid/java/systests/build.xml Thu Feb 19 10:03:18 2009
@@ -20,7 +20,7 @@
  -->
 <project name="System Tests" default="build">
 
-    <property name="module.depends" value="client broker common junit-toolkit"/>
+    <property name="module.depends" value="client broker broker/test common junit-toolkit"/>
     <property name="module.test.src" location="src/main/java"/>
     <property name="module.test.excludes"
               value="**/TTLTest.java,**/DropInTest.java,**/TestClientControlledTest.java"/>

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java Thu Feb 19 10:03:18 2009
@@ -59,10 +59,6 @@
         }
 
         ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile);
-
-        // This is a bit evil it should be updated with QPID-1103
-        config.getConfiguration().setProperty("management.enabled", "false");
-
         startBroker();
     }
 

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=745799&r1=745798&r2=745799&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Thu Feb 19 10:03:18 2009
@@ -61,12 +61,7 @@
         }
 
         ConfigurationFileApplicationRegistry config = new ConfigurationFileApplicationRegistry(defaultaclConfigFile);
-
-        // This is a bit evil it should be updated with QPID-1103
-        config.getConfiguration().setProperty("management.enabled", "false");
-
         ApplicationRegistry.initialise(config, 1);
-
         TransportConnection.createVMBroker(1);
     }
 

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=745799&r1=745798&r2=745799&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 Thu Feb 19 10:03:18 2009
@@ -27,6 +27,7 @@
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.ContentChunk;
 import org.apache.qpid.server.virtualhost.VirtualHost;
+import org.apache.qpid.server.configuration.VirtualHostConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.queue.MessageMetaData;
@@ -49,38 +50,38 @@
     private static final String POST = "post";
     private String DEFAULT_DELAY = "default";
 
-    public void configure(VirtualHost virtualHost, String base, Configuration config) throws Exception
+    public void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration config) throws Exception
     {
-        _logger.info("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
-        Configuration delays = config.subset(base + "." + DELAYS);
+        _logger.warn("Starting SlowMessageStore on Virtualhost:" + virtualHost.getName());
+        Configuration delays = config.getStoreConfiguration().subset(DELAYS);
 
         configureDelays(delays);
 
-        String transactionLogClass = config.getString(base + ".store.class");
+        String transactionLogClass = config.getTransactionLogClass();
 
         if (delays.containsKey(DEFAULT_DELAY))
         {
             _defaultDelay = delays.getLong(DEFAULT_DELAY);
+            _logger.warn("Delay is:" + _defaultDelay);
         }
 
         if (transactionLogClass != null)
         {
             Class clazz = Class.forName(transactionLogClass);
+            if (clazz != this.getClass())
+            {
 
-            Object o = clazz.newInstance();
+                Object o = clazz.newInstance();
 
-            if (!(o instanceof TransactionLog))
-            {
-                throw new ClassCastException("TransactionLog class must implement " + TransactionLog.class + ". Class " + clazz +
-                                             " does not.");
+                if (!(o instanceof TransactionLog))
+                {
+                    throw new ClassCastException("TransactionLog class must implement " + TransactionLog.class + ". Class " + clazz +
+                    " does not.");
+                }
+                _realTransactionLog = (TransactionLog) o;
             }
-            _realTransactionLog = (TransactionLog) o;
-            _realTransactionLog.configure(virtualHost, base , config);
-        }
-        else
-        {
-            _realTransactionLog.configure(virtualHost, base , config);
         }
+        _realTransactionLog.configure(virtualHost, base , config);
     }
 
     private void configureDelays(Configuration config)



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message