qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritch...@apache.org
Subject svn commit: r635590 - in /incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server: registry/ConfigurationFileApplicationRegistry.java security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
Date Mon, 10 Mar 2008 16:27:17 GMT
Author: ritchiem
Date: Mon Mar 10 09:27:07 2008
New Revision: 635590

URL: http://svn.apache.org/viewvc?rev=635590&view=rev
Log:
QIPD-841 : Problem with SimpleACLTest was that the ConfigurationFilePrincipalDatabaseManager
was looking up the ApplicationRegistry for the configuration. Most of the time this is ok
but during test tearDown/startUp sometimes the config is null on lookup. This method is just
wrong anyway. the ConfigurationFilePrincipalDatabaseManager setup is the only setup that looksup
the configuration from the AppRegistry. So adjusted so that it takes it as a parameter as
other classes do.

Modified:
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java

Modified: incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java?rev=635590&r1=635589&r2=635590&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
(original)
+++ incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
Mon Mar 10 09:27:07 2008
@@ -58,10 +58,6 @@
 
     private VirtualHostRegistry _virtualHostRegistry;
 
-
-    //fixme Why is this not used.
-    private final Map<String, VirtualHost> _virtualHosts = new ConcurrentHashMap<String,
VirtualHost>();
-
     private PluginManager _pluginManager;
 
 
@@ -113,7 +109,7 @@
 
         _accessManager = ACLManager.loadACLManager("default", _configuration);
 
-        _databaseManager = new ConfigurationFilePrincipalDatabaseManager();
+        _databaseManager = new ConfigurationFilePrincipalDatabaseManager(_configuration);
 
         _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
 

Modified: incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java?rev=635590&r1=635589&r2=635590&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
(original)
+++ incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
Mon Mar 10 09:27:07 2008
@@ -50,17 +50,16 @@
 
     Map<String, PrincipalDatabase> _databases;
 
-    public ConfigurationFilePrincipalDatabaseManager() throws Exception
+    public ConfigurationFilePrincipalDatabaseManager(Configuration configuration) throws
Exception
     {
         _logger.info("Initialising PrincipleDatabase authentication manager");
-        _databases = initialisePrincipalDatabases();
+        _databases = initialisePrincipalDatabases(configuration);
     }
 
-    private Map<String, PrincipalDatabase> initialisePrincipalDatabases() throws Exception
+    private Map<String, PrincipalDatabase> initialisePrincipalDatabases(Configuration
configuration) throws Exception
     {
-        Configuration config = ApplicationRegistry.getInstance().getConfiguration();
-        List<String> databaseNames = config.getList(_base + ".name");
-        List<String> databaseClasses = config.getList(_base + ".class");
+        List<String> databaseNames = configuration.getList(_base + ".name");
+        List<String> databaseClasses = configuration.getList(_base + ".class");
         Map<String, PrincipalDatabase> databases = new HashMap<String, PrincipalDatabase>();
 
         if (databaseNames.size() == 0)
@@ -85,7 +84,7 @@
                 throw new Exception("Principal databases must implement the PrincipalDatabase
interface");
             }
 
-            initialisePrincipalDatabase((PrincipalDatabase) o, config, i);
+            initialisePrincipalDatabase((PrincipalDatabase) o, configuration, i);
 
             String name = databaseNames.get(i);
             if ((name == null) || (name.length() == 0))
@@ -200,7 +199,7 @@
             }
 
             String jmxaccesssFile = null;
-            
+
             try
             {
                 jmxaccesssFile = PropertyUtils.replaceProperties(jmxaccesslist.get(0));



Mime
View raw message