com.sun.jdmk
Class Introspector

java.lang.Object
  |
  +--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 c)
          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 c)
          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.
Since:
JDMK 5.0

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.
Since:
JDMK 5.0

testCompliance

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

Parameters:
c - 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 c)
Get the MBean interface implemented by a JMX standard MBean class.

Parameters:
c - 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.

JMX 1.2_8   2002.10.31_20:03:55_MET

Copyright 1999-2002 Sun Microsystems, Inc.   901 San Antonio Road Palo Alto, California, 94303, U.S.A.   All Rights Reserved.