summaryrefslogtreecommitdiff
path: root/qpid/java/broker/src/main
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-08-06 09:26:56 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-08-06 09:26:56 +0000
commitcf1d99773dbfb66c7d0b3c141530b01b69fa0576 (patch)
tree393363ebe3ac8d82d4a778d85e18268375e930c5 /qpid/java/broker/src/main
parent8dd5f83bc7dd0e099627f20c62afa050af0e6335 (diff)
downloadqpid-python-cf1d99773dbfb66c7d0b3c141530b01b69fa0576.tar.gz
QPID-2028 : Ensure all Non QpidTestCase System tests correctly clean up by removing the ApplicationRegistry they create.
The biggest offenders are the broker tests which are not pure unit tests. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@801561 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker/src/main')
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java10
-rw-r--r--qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java87
2 files changed, 9 insertions, 88 deletions
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
index b58b849133..edad8e53aa 100644
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
+++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
@@ -36,6 +36,7 @@ import org.apache.qpid.server.security.auth.manager.AuthenticationManager;
import org.apache.qpid.server.virtualhost.VirtualHost;
import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
import org.apache.qpid.server.logging.RootMessageLogger;
+import org.apache.qpid.server.logging.actors.CurrentActor;
/**
* An abstract application registry that provides access to configuration information and handles the
@@ -115,11 +116,18 @@ public abstract class ApplicationRegistry implements IApplicationRegistry
}
/**
+ * Method to cleanly shutdown the default registry running in this JVM
+ */
+ public static void remove()
+ {
+ remove(DEFAULT_INSTANCE);
+ }
+
+ /**
* Method to cleanly shutdown specified registry running in this JVM
*
* @param instanceID the instance to shutdown
*/
-
public static void remove(int instanceID)
{
try
diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
deleted file mode 100644
index 9ef1e029d3..0000000000
--- a/qpid/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.util;
-
-import org.apache.commons.configuration.ConfigurationException;
-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.logging.RootMessageLoggerImpl;
-import org.apache.qpid.server.logging.rawloggers.Log4jMessageLogger;
-import org.apache.qpid.server.management.NoopManagedObjectRegistry;
-import org.apache.qpid.server.plugins.PluginManager;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.access.ACLManager;
-import org.apache.qpid.server.security.access.plugins.AllowAll;
-import org.apache.qpid.server.security.auth.database.PropertiesPrincipalDatabaseManager;
-import org.apache.qpid.server.security.auth.manager.PrincipalDatabaseAuthenticationManager;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Properties;
-
-public class NullApplicationRegistry extends ApplicationRegistry
-{
- public NullApplicationRegistry() throws ConfigurationException
- {
- super(new ServerConfiguration(new PropertiesConfiguration()));
- }
-
- public void initialise() throws Exception
- {
- _logger.info("Initialising NullApplicationRegistry");
-
- _rootMessageLogger = new RootMessageLoggerImpl(_configuration, new Log4jMessageLogger());
-
- _configuration.setHousekeepingExpiredMessageCheckPeriod(200);
-
- Properties users = new Properties();
-
- users.put("guest", "guest");
-
- _databaseManager = new PropertiesPrincipalDatabaseManager("default", users);
-
- _accessManager = new ACLManager(_configuration.getSecurityConfiguration(), _pluginManager, AllowAll.FACTORY);
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
- _managedObjectRegistry = new NoopManagedObjectRegistry();
- _virtualHostRegistry = new VirtualHostRegistry(this);
- PropertiesConfiguration vhostProps = new PropertiesConfiguration();
- VirtualHostConfiguration hostConfig = new VirtualHostConfiguration("test", vhostProps);
- VirtualHost dummyHost = new VirtualHost(hostConfig);
- _virtualHostRegistry.registerVirtualHost(dummyHost);
- _virtualHostRegistry.setDefaultVirtualHostName("test");
- _pluginManager = new PluginManager("");
-
- }
-
- public Collection<String> getVirtualHostNames()
- {
- String[] hosts = {"test"};
- return Arrays.asList(hosts);
- }
-}
-
-
-