[jboss-cvs] JBossAS SVN: r59165 - branches/Branch_4_0/system/src/main/org/jboss/system/server/jmx

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 19 19:46:22 EST 2006


Author: scott.stark at jboss.org
Date: 2006-12-19 19:46:20 -0500 (Tue, 19 Dec 2006)
New Revision: 59165

Modified:
   branches/Branch_4_0/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java
Log:
JBAS-3947, reload the server domains on InstanceNotFoundException failures in isInstanceOf calls.

Modified: branches/Branch_4_0/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java
===================================================================
--- branches/Branch_4_0/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2006-12-20 00:12:59 UTC (rev 59164)
+++ branches/Branch_4_0/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2006-12-20 00:46:20 UTC (rev 59165)
@@ -61,9 +61,13 @@
 public class LazyMBeanServer
    implements MBeanServer
 {
+   /** The MBeanServer that was registered */
    private static MBeanServer registeredServer;
+   /** The jboss MBeanServer implementation */
    private static MBeanServer theServer;
+   /** The jdk MBeanServer implementation */
    private static MBeanServer platformServer;
+   /** The default domain to use for mbeans */
    private static String defaultDomain;
    private static MBeanServerDelegate theDelegate;
    /** A HashSet<String> of the jmx domain prefixes that need to be
@@ -137,6 +141,14 @@
          serverDomains.add(domains[n]);
       }
    }
+   /**
+    * 
+    * @param domain - the default domain when an MBean is
+    *        registered with an ObjectName without a domain
+    * @param outer - the wrapping MBeanServer, passed to MBeans
+    *        at registration.
+    * @param delegate the delegate to use for Notifications.
+    */
    LazyMBeanServer(String domain, MBeanServer outer,
       MBeanServerDelegate delegate)
    {
@@ -370,7 +382,17 @@
    public boolean isInstanceOf(ObjectName name, String className)
       throws InstanceNotFoundException
    {
-      return getServer(name).isInstanceOf(name, className);
+      boolean isInstanceOf = false;
+      try
+      {
+         isInstanceOf = getServer(name).isInstanceOf(name, className);
+      }
+      catch(InstanceNotFoundException e)
+      {
+         reloadDomains();
+         isInstanceOf = getServer(name).isInstanceOf(name, className);
+      }
+      return isInstanceOf;
    }
 
    public Object instantiate(String className)




More information about the jboss-cvs-commits mailing list