You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2008/07/16 18:27:13 UTC

svn commit: r677327 - /incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java

Author: ritchiem
Date: Wed Jul 16 09:27:11 2008
New Revision: 677327

URL: http://svn.apache.org/viewvc?rev=677327&view=rev
Log:
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.

Modified:
    incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java

Modified: incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java?rev=677327&r1=677326&r2=677327&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java (original)
+++ incubator/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java Wed Jul 16 09:27:11 2008
@@ -70,7 +70,6 @@
 
     protected PluginManager _pluginManager;
 
-
     static
     {
         Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownService()));
@@ -123,15 +122,18 @@
         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 @@
 
     /** 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 void close() throws Exception
     {
+        if (_logger.isInfoEnabled())
+        {
+            _logger.info("Shutting down ApplicationRegistry:"+this);
+        }
+
         //Stop incomming connections
         unbind();
 
@@ -201,9 +208,9 @@
         }
 
         // 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 @@
         return instance;
     }
 
-
     public static void setDefaultApplicationRegistry(String clazz)
     {
         _APPLICATION_REGISTRY = clazz;