com.sun.jdmk
Class Introspector

java.lang.Object
  extended by com.sun.jdmk.Introspector

public class Introspector
extends Object

This class contains the methods for performing all the tests needed to verify that a class represents a JMX compliant MBean.


Method Summary
static Class getMBeanInterface(Class baseClass)
          Get the MBean interface implemented by a JMX standard MBean class.
static boolean isDynamic(Class c)
          Tell whether a MBean of the given class is a Dynamic MBean.
static MBeanInfo testCompliance(Class baseClass)
          Basic method for testing if a given class is a JMX compliant MBean.
static void testCreation(Class c)
          Basic method for testing that a MBean of a given class can be instantiated by the MBean server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDynamic

public static final boolean isDynamic(Class c)
Tell whether a MBean of the given class is a Dynamic MBean. This method does nothing more than returning
 javax.management.DynamicMBean.class.isAssignableFrom(c)
 
This method does not check for any JMX MBean compliance:

Parameters:
c - The class of the MBean under examination.
Returns:
true if instances of c are Dynamic MBeans, false otherwise.

testCreation

public static void testCreation(Class c)
                         throws NotCompliantMBeanException
Basic method for testing that a MBean of a given class can be instantiated by the MBean server.

This method checks that:

If these conditions are not met, throws a NotCompliantMBeanException.

Parameters:
c - The class of the MBean we want to create.
Throws:
NotCompliantMBeanException - if the MBean class makes it impossible to instantiate the MBean from within the MBeanServer.

testCompliance

public static MBeanInfo testCompliance(Class baseClass)
                                throws NotCompliantMBeanException
Basic method for testing if a given class is a JMX compliant MBean.

Parameters:
baseClass - The class to be tested
Returns:
null if the MBean is a DynamicMBean, the computed MBeanInfo otherwise.
Throws:
NotCompliantMBeanException - The specified class is not a JMX compliant MBean

getMBeanInterface

public static Class getMBeanInterface(Class baseClass)
Get the MBean interface implemented by a JMX standard MBean class.

Parameters:
baseClass - The class to be tested
Returns:
The MBean interface implemented by the MBean. Return null if the MBean is a DynamicMBean, or if no MBean interface is found.

Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.