qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rob...@apache.org
Subject svn commit: r762992 - /qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
Date Tue, 07 Apr 2009 22:08:02 GMT
Author: robbie
Date: Tue Apr  7 22:08:02 2009
New Revision: 762992

URL: http://svn.apache.org/viewvc?rev=762992&view=rev
Log:
QPID-1792: make JMXManagedObjectRegistry.close() method attempt to de-register only qpid related
MBeans, preventing the RuntimeException that is a result of attempting to de-register the
platform MBeanServerDelegate MBean, which is not allowed. Also remove unused imports.

Modified:
    qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java?rev=762992&r1=762991&r2=762992&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
Tue Apr  7 22:08:02 2009
@@ -25,21 +25,14 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.server.registry.ApplicationRegistry;
 import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.security.auth.database.Base64MD5PasswordFilePrincipalDatabase;
-import org.apache.qpid.server.security.auth.database.PlainPasswordFilePrincipalDatabase;
 import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
 import org.apache.qpid.server.security.auth.rmi.RMIPasswordAuthenticator;
-import org.apache.qpid.server.security.auth.sasl.crammd5.CRAMMD5HashedInitialiser;
-import org.apache.qpid.server.security.auth.sasl.plain.PlainInitialiser;
 
-import javax.management.InstanceNotFoundException;
 import javax.management.JMException;
-import javax.management.MBeanRegistrationException;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
 import javax.management.remote.JMXConnectorServer;
-import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
 import javax.management.remote.MBeanServerForwarder;
 import javax.management.remote.rmi.RMIConnectorServer;
@@ -342,7 +335,7 @@
         return false;
     }
 
-    // stops the RMIRegistry, if it was running and bound to a port
+    // stops the RMIRegistry and unregisters the MBeans from the MBeanServer
     public void close() throws RemoteException
     {
         if (_rmiRegistry != null)
@@ -350,7 +343,19 @@
             // Stopping the RMI registry
             UnicastRemoteObject.unexportObject(_rmiRegistry, true);
         }
-        for (ObjectName name : _mbeanServer.queryNames(null, null))
+        
+        //ObjectName query to gather all Qpid related MBeans
+        ObjectName mbeanNameQuery = null;
+        try
+        {
+            mbeanNameQuery = new ObjectName(ManagedObject.DOMAIN + ":*");
+        }
+        catch (Exception e1)
+        {
+            _log.warn("Unable to generate MBean ObjectName query for close operation");
+        }
+
+        for (ObjectName name : _mbeanServer.queryNames(mbeanNameQuery, null))
         {
             try
             {
@@ -358,7 +363,7 @@
             }
             catch (JMException e)
             {
-                // Really shouldn't happen, but we'll ignore that...
+                _log.error("Exception unregistering MBean '"+ name +"': " + e.getMessage());
             }
         }
     }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message