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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jan 8 04:00:51 EST 2007


Author: scott.stark at jboss.org
Date: 2007-01-08 04:00:49 -0500 (Mon, 08 Jan 2007)
New Revision: 59408

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

Modified: branches/JBoss_4_0_5_GA_CP/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java
===================================================================
--- branches/JBoss_4_0_5_GA_CP/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2007-01-08 06:45:44 UTC (rev 59407)
+++ branches/JBoss_4_0_5_GA_CP/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2007-01-08 09:00:49 UTC (rev 59408)
@@ -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)


Property changes on: branches/JBoss_4_0_5_GA_CP/system/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java
___________________________________________________________________
Name: svn:eol-style
   - native
   + LF




More information about the jboss-cvs-commits mailing list