public class

Introspector

extends Object
java.lang.Object
   ↳ com.sun.jmx.mbeanserver.Introspector

Class Overview

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

Summary

Public Methods
static void checkCompliance(Class mbeanClass)
static Descriptor descriptorForAnnotations(Annotation[] annots)
static Descriptor descriptorForElement(AnnotatedElement elmt)
static Class getMBeanInterface(Class baseClass)
Get the MBean interface implemented by a JMX Standard MBean class.
static Class getMXBeanInterface(Class baseClass)
Get the MXBean interface implemented by a JMX MXBean class.
static Class getStandardMBeanInterface(Class baseClass)
Get the MBean interface implemented by a JMX Standard MBean class.
final static boolean isDynamic(Class c)
Tell whether a MBean of the given class is a Dynamic MBean.
static DynamicMBean makeDynamicMBean(Object mbean)
static MBeanInfo testCompliance(Class baseClass)
Basic method for testing if a given class is a JMX compliant MBean.
synchronized static MBeanInfo testCompliance(Class<?> baseClass, Class<?> mbeanInterface)
Basic method for testing if a given class is a JMX compliant Standard MBean.
static void testComplianceMXBeanInterface(Class interfaceClass)
static void testCreation(Class c)
Basic method for testing that a MBean of a given class can be instantiated by the MBean server.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static void checkCompliance (Class mbeanClass)

public static Descriptor descriptorForAnnotations (Annotation[] annots)

public static Descriptor descriptorForElement (AnnotatedElement elmt)

public static Class getMBeanInterface (Class baseClass)

Get the MBean interface implemented by a JMX Standard MBean class. This method is only called by the legacy code in "com.sun.management.jmx".

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.

public static Class getMXBeanInterface (Class baseClass)

Get the MXBean interface implemented by a JMX MXBean class.

Parameters
baseClass The class to be tested.
Returns
  • The MXBean interface implemented by the MXBean.
Throws
NotCompliantMBeanException The specified class is not a JMX compliant MXBean.

public static Class getStandardMBeanInterface (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 Standard MBean.
Throws
NotCompliantMBeanException The specified class is not a JMX compliant Standard MBean.

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:
  • If true is returned, then instances of c are DynamicMBean.
  • If false is returned, then no further assumption can be made on instances of c. In particular, instances of c may, or may not be JMX standard MBeans.

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

public static DynamicMBean makeDynamicMBean (Object mbean)

public static MBeanInfo testCompliance (Class baseClass)

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

public static synchronized MBeanInfo testCompliance (Class<?> baseClass, Class<?> mbeanInterface)

Basic method for testing if a given class is a JMX compliant Standard MBean. This method is only called by the legacy code in com.sun.management.jmx.

Parameters
baseClass The class to be tested.
mbeanInterface the MBean interface that the class implements, or null if the interface must be determined by introspection.
Returns
Throws
NotCompliantMBeanException The specified class is not a JMX compliant Standard MBean

public static void testComplianceMXBeanInterface (Class interfaceClass)

public static void testCreation (Class c)

Basic method for testing that a MBean of a given class can be instantiated by the MBean server.

This method checks that:

  • The given class is a concrete class.
  • The given class exposes at least one public constructor.
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.