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 | 1848880ade63a0d2e2e9472a3fc231c52962dd78 (patch) | |
tree | b330d48f5520f22a192d45560686302b5ef785a5 | |
parent | 2ea878974b0ddb24c9ca08756efafb38bd548748 (diff) | |
download | qpid-python-1848880ade63a0d2e2e9472a3fc231c52962dd78.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/qpid@677327 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java b/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java index a355edee9a..63171d583a 100644 --- a/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java +++ b/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; |