com.sun.jdmk
Class Introspector

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

public class Introspector
extends java.lang.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 java.lang.Class getMBeanInterface(java.lang.Class baseClass)
          Get the MBean interface implemented by a JMX standard MBean class.
static boolean isDynamic(java.lang.Class c)
          Tell whether a MBean of the given class is a Dynamic MBean.
static javax.management.MBeanInfo testCompliance(java.lang.Class baseClass)
          Basic method for testing if a given class is a JMX compliant MBean.
static void testCreation(java.lang.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(java.lang.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(java.lang.Class c)
                         throws javax.management.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:
javax.management.NotCompliantMBeanException - if the MBean class makes it impossible to instantiate the MBean from within the MBeanServer.

testCompliance

public static javax.management.MBeanInfo testCompliance(java.lang.Class baseClass)
                                                 throws javax.management.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:
javax.management.NotCompliantMBeanException - The specified class is not a JMX compliant MBean

getMBeanInterface

public static java.lang.Class getMBeanInterface(java.lang.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 01-ea
opendmk-1.0-b01-ea 2010.10.20_19:39:55_UTC

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