diff options
author | Martin Ritchie <ritchiem@apache.org> | 2008-07-16 16:27:11 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2008-07-16 16:27:11 +0000 |
commit | 1fa9984f40a0b6d2b8bc94dab775a234c2fc029c (patch) | |
tree | a0f37681b29d90e037830aa457574e27a3bec547 | |
parent | 0963af8c38efae6f28df2ec77623d47b97018a97 (diff) | |
download | qpid-python-1fa9984f40a0b6d2b8bc94dab775a234c2fc029c.tar.gz |
QPID-871 : The shutdown change had a spurious getInstance() call which would case a new instance of ID 1 to be created if there wasn't one, it would then procede to shutdown that MBeanServer not the MBeanServer attached to the ApplicationRegistry that is being shutdown.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@677327 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java | 22 |
1 files changed, 14 insertions, 8 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 a355edee9a..63171d583a 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 @@ -70,7 +70,6 @@ public abstract class ApplicationRegistry implements IApplicationRegistry protected PluginManager _pluginManager; - static { Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownService())); @@ -123,15 +122,18 @@ public abstract class ApplicationRegistry implements IApplicationRegistry try { IApplicationRegistry instance = _instanceMap.get(instanceID); - if(instance != null) + if (instance != null) { + if (_logger.isInfoEnabled()) + { + _logger.info("Shuting down ApplicationRegistry(" + instanceID + "):" + instance); + } instance.close(); } } catch (Exception e) { - _logger.error("Error shutting down message store: " + e, e); - + _logger.error("Error shutting down Application Registry(" + instanceID + "): " + e, e); } finally { @@ -141,7 +143,7 @@ public abstract class ApplicationRegistry implements IApplicationRegistry /** Method to cleanly shutdown all registries currently running in this JVM */ public static void removeAll() - { + { Object[] keys = _instanceMap.keySet().toArray(); for (Object k : keys) { @@ -191,6 +193,11 @@ public abstract class ApplicationRegistry implements IApplicationRegistry public void close() throws Exception { + if (_logger.isInfoEnabled()) + { + _logger.info("Shutting down ApplicationRegistry:"+this); + } + //Stop incomming connections unbind(); @@ -201,9 +208,9 @@ public abstract class ApplicationRegistry implements IApplicationRegistry } // close the rmi registry(if any) started for management - if (getInstance().getManagedObjectRegistry() != null) + if (getManagedObjectRegistry() != null) { - getInstance().getManagedObjectRegistry().close(); + getManagedObjectRegistry().close(); } } @@ -252,7 +259,6 @@ public abstract class ApplicationRegistry implements IApplicationRegistry return instance; } - public static void setDefaultApplicationRegistry(String clazz) { _APPLICATION_REGISTRY = clazz; |