[jboss-cvs] JBossAS SVN: r59166 - trunk/system-jmx/src/main/org/jboss/system/server/jmx

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


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

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

Modified: trunk/system-jmx/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java
===================================================================
--- trunk/system-jmx/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2006-12-20 00:46:20 UTC (rev 59165)
+++ trunk/system-jmx/src/main/org/jboss/system/server/jmx/LazyMBeanServer.java	2006-12-20 01:46:31 UTC (rev 59166)
@@ -1,24 +1,24 @@
 /*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
 package org.jboss.system.server.jmx;
 
 import java.io.ObjectInputStream;
@@ -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
@@ -370,7 +374,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