qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r764428 [2/2] - in /qpid/branches/0.5-fix/qpid/java/broker/src: main/java/org/apache/qpid/server/ main/java/org/apache/qpid/server/configuration/ main/java/org/apache/qpid/server/exchange/ main/java/org/apache/qpid/server/handler/ main/java...
Date Mon, 13 Apr 2009 12:42:40 GMT
Modified: qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/DerbyMessageStore.java Mon Apr 13 12:42:38 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;
@@ -139,7 +140,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
     {
         stateTransition(State.INITIAL, State.CONFIGURING);
 
@@ -150,8 +151,8 @@
         _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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java Mon Apr 13 12:42:38 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;
@@ -62,15 +63,15 @@
         _contentBodyMap = new ConcurrentHashMap<Long, List<ContentChunk>>(DEFAULT_HASHTABLE_CAPACITY);
     }
 
-    public void configure(String base, Configuration config)
+    public void configure(String base, VirtualHostConfiguration config)
     {
-        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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java Mon Apr 13 12:42:38 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;
@@ -61,11 +62,11 @@
      * @param virtualHost The virtual host using by this store
      * @param base        The base element identifier from which all configuration items are relative. For example, if
      *                    the base element is "store", the all elements used by concrete classes will be "store.foo" etc.
-     * @param config      The apache commons configuration object.
+     * @param hostConfig      The apache commons configuration object.
      *
      * @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 hostConfig) throws Exception;
 
     /**
      * Called to close and cleanup any resources used by the message store.

Modified: qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java Mon Apr 13 12:42:38 2009
@@ -20,26 +20,34 @@
  */
 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.ConfigurationException;
 import org.apache.commons.configuration.PropertiesConfiguration;
 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.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;
@@ -77,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. ("
@@ -125,47 +130,21 @@
 
     } // End of MBean class
 
-    /**
-     * Used for testing only
-     * @param name
-     * @param store
-     * @throws Exception
-     */
-    public VirtualHost(String name, MessageStore store) throws Exception
-    {
-        this(name, new PropertiesConfiguration(), store);
-    }
-
-    /**
-     * Normal Constructor
-     * @param name
-     * @param hostConfig
-     * @throws Exception
-     */
-    public VirtualHost(String name, Configuration hostConfig) throws Exception
-    {
-        this(name, hostConfig, null);
-    }
 
-    public VirtualHost(String name, Configuration hostConfig, MessageStore store) throws Exception
+    public VirtualHost(VirtualHostConfiguration hostConfig, MessageStore store) 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 (store != null)
         {
             _messageStore = store;
@@ -178,24 +157,32 @@
             }
             initialiseMessageStore(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)
+    public VirtualHost(VirtualHostConfiguration virtualHostConfig) throws Exception 
+    {
+		this(virtualHostConfig, null);
+	}
+
+	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)
         {
@@ -225,9 +212,9 @@
         }
     }
     
-    private void initialiseMessageStore(Configuration config) throws Exception
+    private void initialiseMessageStore(VirtualHostConfiguration hostConfig) throws Exception
     {
-        String messageStoreClass = config.getString("store.class");
+        String messageStoreClass = hostConfig.getMessageStoreClass();
 
         Class clazz = Class.forName(messageStoreClass);
         Object o = clazz.newInstance();
@@ -238,25 +225,88 @@
                                          " does not.");
         }
         _messageStore = (MessageStore) o;
-        _messageStore.configure(this, "store", config);
+        _messageStore.configure(this, "store", hostConfig);
     }
 
+    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();
 
-    public <T> T getConfiguredObject(Class<T> instanceType, Configuration config)
+    	for(Object queueNameObj : queueNames)
+    	{
+    		String queueName = String.valueOf(queueNameObj);
+    		configureQueue(config.getQueueConfiguration(queueName));
+    	}
+    }
+
+    private void configureExchange(ExchangeConfiguration exchangeConfiguration) throws AMQException
     {
-        T instance;
-        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);
+    	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);
+    	}
+    }
+
+    private void configureQueue(QueueConfiguration queueConfiguration) throws AMQException, ConfigurationException
+    {
+    	AMQQueue queue = AMQQueueFactory.createAMQQueueImpl(queueConfiguration, this);
+
+    	if (queue.isDurable())
+    	{
+    		_messageStore.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())
+    	{
+    		routingKeys = Collections.singletonList(queue.getName());
+    	}
+
+    	for(Object routingKeyNameObj : routingKeys)
+    	{
+    		AMQShortString routingKey = new AMQShortString(String.valueOf(routingKeyNameObj));
+    		queue.bind(exchange, routingKey, null);
+    		_logger.info("Queue '" + queue.getName() + "' bound to exchange:" + exchangeName + " RK:'" + routingKey + "'");
+    	}
 
-        return instance;
+    	if(exchange != _exchangeRegistry.getDefaultExchange())
+    	{
+    		queue.bind(_exchangeRegistry.getDefaultExchange(), queue.getName(), null);
+    	}
     }
 
     public String getName()

Modified: qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/ack/TxAckTest.java Mon Apr 13 12:42:38 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.MessageHandleFactory;
 import org.apache.qpid.server.queue.QueueEntry;
@@ -118,8 +121,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), null);
+            
+            _queue = AMQQueueFactory.createAMQQueueImpl(new AMQShortString("test"), false, null, false,
+                    virtualHost, null);
 
             for (int i = 0; i < messageCount; i++)
             {

Modified: qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/configuration/VirtualHostConfigurationTest.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java Mon Apr 13 12:42:38 2009
@@ -249,26 +249,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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/MockAMQQueue.java Mon Apr 13 12:42:38 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;
@@ -308,11 +309,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.
@@ -322,4 +318,11 @@
     {
         return 0;  //To change body of implemented methods use File | Settings | File Templates.
     }
+
+    @Override
+    public void setMinimumAlertRepeatGap(long value)
+    {
+        
+    }
+
 }

Modified: qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/queue/SimpleAMQQueueTest.java Mon Apr 13 12:42:38 2009
@@ -26,6 +26,7 @@
 
 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.BasicContentHeaderProperties;
@@ -33,6 +34,7 @@
 import org.apache.qpid.framing.ContentHeaderProperties;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
+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.registry.ApplicationRegistry;
@@ -94,7 +96,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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/registry/ApplicationRegistryShutdownTest.java Mon Apr 13 12:42:38 2009
@@ -39,7 +39,7 @@
 
     ApplicationRegistry _registry;
 
-    public void setUp()
+    public void setUp() throws Exception
     {
         _registry = new TestApplicationRegistry();
     }

Modified: qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/ACLManagerTest.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/PrincipalPermissionsTest.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/security/access/plugins/network/FirewallPluginTest.java Mon Apr 13 12:42:38 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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/MessageStoreTest.java Mon Apr 13 12:42:38 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;
@@ -101,7 +103,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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/store/SkeletonMessageStore.java Mon Apr 13 12:42:38 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 java.util.List;
@@ -45,7 +46,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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/InternalBrokerBaseCase.java Mon Apr 13 12:42:38 2009
@@ -21,10 +21,13 @@
 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.server.configuration.ServerConfiguration;
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.protocol.InternalTestProtocolSession;
 import org.apache.qpid.server.AMQChannel;
@@ -57,7 +60,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/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java?rev=764428&r1=764427&r2=764428&view=diff
==============================================================================
--- qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java (original)
+++ qpid/branches/0.5-fix/qpid/java/broker/src/test/java/org/apache/qpid/server/util/TestApplicationRegistry.java Mon Apr 13 12:42:38 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;
@@ -54,9 +58,17 @@
     private VirtualHost _vHost;
 
 
-    public TestApplicationRegistry()
+    private ServerConfiguration _config;
+    
+    public TestApplicationRegistry() throws ConfigurationException
     {
-        super(new MapConfiguration(new HashMap()));
+    	super(new ServerConfiguration(new PropertiesConfiguration()));
+    }
+
+    public TestApplicationRegistry(ServerConfiguration config) throws ConfigurationException
+    {
+    	super(config);
+    	_config = config;
     }
 
     public void initialise() throws Exception
@@ -67,7 +79,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);
 
@@ -76,8 +88,10 @@
         _messageStore = new TestableMemoryMessageStore();
 
         _virtualHostRegistry = new VirtualHostRegistry();
-
-        _vHost = new VirtualHost("test", _messageStore);
+        
+        PropertiesConfiguration vhostProps = new PropertiesConfiguration();
+        VirtualHostConfiguration hostConfig = new VirtualHostConfiguration("test", vhostProps);
+        _vHost = new VirtualHost(hostConfig, _messageStore);
 
         _virtualHostRegistry.registerVirtualHost(_vHost);
 
@@ -85,7 +99,6 @@
         _exchangeFactory = _vHost.getExchangeFactory();
         _exchangeRegistry = _vHost.getExchangeRegistry();
 
-        _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
     }
 
     public QueueRegistry getQueueRegistry()



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


Mime
View raw message