< prev index next >

src/java.management/share/classes/java/lang/management/ManagementFactory.java

Print this page




  50 import java.util.Collection;
  51 import java.util.Optional;
  52 import java.util.ServiceLoader;
  53 import java.util.function.Function;
  54 import java.util.stream.Collectors;
  55 import static java.util.stream.Collectors.toMap;
  56 import java.util.stream.Stream;
  57 import javax.management.JMX;
  58 import sun.management.Util;
  59 import sun.management.spi.PlatformMBeanProvider;
  60 import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
  61 
  62 /**
  63  * The {@code ManagementFactory} class is a factory class for getting
  64  * managed beans for the Java platform.
  65  * This class consists of static methods each of which returns
  66  * one or more <i>platform MXBeans</i> representing
  67  * the management interface of a component of the Java virtual
  68  * machine.
  69  *
  70  * <h2><a id="MXBean">Platform MXBeans</a></h2>
  71  * <p>
  72  * A platform MXBean is a <i>managed bean</i> that
  73  * conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
  74  * Instrumentation Specification and only uses a set of basic data types.
  75  * A JMX management application and the {@linkplain
  76  * #getPlatformMBeanServer platform MBeanServer}
  77  * can interoperate without requiring classes for MXBean specific
  78  * data types.
  79  * The data types being transmitted between the JMX connector
  80  * server and the connector client are
  81  * {@linkplain javax.management.openmbean.OpenType open types}
  82  * and this allows interoperation across versions.
  83  * See <a href="../../../javax/management/MXBean.html#MXBean-spec">
  84  * the specification of MXBeans</a> for details.
  85  *
  86  * <a id="MXBeanNames"></a>
  87  * <p>Each platform MXBean is a {@link PlatformManagedObject}
  88  * and it has a unique
  89  * {@link javax.management.ObjectName ObjectName} for
  90  * registration in the platform {@code MBeanServer} as returned by
  91  * by the {@link PlatformManagedObject#getObjectName getObjectName}
  92  * method.
  93  *
  94  * <p>
  95  * An application can access a platform MXBean in the following ways:
  96  * <h3>1. Direct access to an MXBean interface</h3>
  97  * <blockquote>
  98  * <ul>
  99  *     <li>Get an MXBean instance by calling the
 100  *         {@link #getPlatformMXBean(Class) getPlatformMXBean} or
 101  *         {@link #getPlatformMXBeans(Class) getPlatformMXBeans} method
 102  *         and access the MXBean locally in the running
 103  *         virtual machine.
 104  *         </li>
 105  *     <li>Construct an MXBean proxy instance that forwards the
 106  *         method calls to a given {@link MBeanServer MBeanServer} by calling
 107  *         the {@link #getPlatformMXBean(MBeanServerConnection, Class)} or
 108  *         {@link #getPlatformMXBeans(MBeanServerConnection, Class)} method.
 109  *         The {@link #newPlatformMXBeanProxy newPlatformMXBeanProxy} method
 110  *         can also be used to construct an MXBean proxy instance of
 111  *         a given {@code ObjectName}.
 112  *         A proxy is typically constructed to remotely access
 113  *         an MXBean of another running virtual machine.
 114  *         </li>
 115  * </ul>
 116  * <h3>2. Indirect access to an MXBean interface via MBeanServer</h3>
 117  * <ul>
 118  *     <li>Go through the platform {@code MBeanServer} to access MXBeans
 119  *         locally or a specific {@code MBeanServerConnection} to access
 120  *         MXBeans remotely.
 121  *         The attributes and operations of an MXBean use only
 122  *         <em>JMX open types</em> which include basic data types,
 123  *         {@link javax.management.openmbean.CompositeData CompositeData},
 124  *         and {@link javax.management.openmbean.TabularData TabularData}
 125  *         defined in
 126  *         {@link javax.management.openmbean.OpenType OpenType}.
 127  *         The mapping is specified in
 128  *         the {@linkplain javax.management.MXBean MXBean} specification
 129  *         for details.
 130  *        </li>
 131  * </ul>
 132  * </blockquote>
 133  *
 134  * <p>
 135  * The {@link #getPlatformManagementInterfaces getPlatformManagementInterfaces}
 136  * method returns all management interfaces supported in the Java virtual machine




  50 import java.util.Collection;
  51 import java.util.Optional;
  52 import java.util.ServiceLoader;
  53 import java.util.function.Function;
  54 import java.util.stream.Collectors;
  55 import static java.util.stream.Collectors.toMap;
  56 import java.util.stream.Stream;
  57 import javax.management.JMX;
  58 import sun.management.Util;
  59 import sun.management.spi.PlatformMBeanProvider;
  60 import sun.management.spi.PlatformMBeanProvider.PlatformComponent;
  61 
  62 /**
  63  * The {@code ManagementFactory} class is a factory class for getting
  64  * managed beans for the Java platform.
  65  * This class consists of static methods each of which returns
  66  * one or more <i>platform MXBeans</i> representing
  67  * the management interface of a component of the Java virtual
  68  * machine.
  69  *
  70  * <h3><a id="MXBean">Platform MXBeans</a></h3>
  71  * <p>
  72  * A platform MXBean is a <i>managed bean</i> that
  73  * conforms to the <a href="../../../javax/management/package-summary.html">JMX</a>
  74  * Instrumentation Specification and only uses a set of basic data types.
  75  * A JMX management application and the {@linkplain
  76  * #getPlatformMBeanServer platform MBeanServer}
  77  * can interoperate without requiring classes for MXBean specific
  78  * data types.
  79  * The data types being transmitted between the JMX connector
  80  * server and the connector client are
  81  * {@linkplain javax.management.openmbean.OpenType open types}
  82  * and this allows interoperation across versions.
  83  * See <a href="../../../javax/management/MXBean.html#MXBean-spec">
  84  * the specification of MXBeans</a> for details.
  85  *
  86  * <a id="MXBeanNames"></a>
  87  * <p>Each platform MXBean is a {@link PlatformManagedObject}
  88  * and it has a unique
  89  * {@link javax.management.ObjectName ObjectName} for
  90  * registration in the platform {@code MBeanServer} as returned by
  91  * by the {@link PlatformManagedObject#getObjectName getObjectName}
  92  * method.
  93  *
  94  * <p>
  95  * An application can access a platform MXBean in the following ways:
  96  * <h4>1. Direct access to an MXBean interface</h4>
  97  * <blockquote>
  98  * <ul>
  99  *     <li>Get an MXBean instance by calling the
 100  *         {@link #getPlatformMXBean(Class) getPlatformMXBean} or
 101  *         {@link #getPlatformMXBeans(Class) getPlatformMXBeans} method
 102  *         and access the MXBean locally in the running
 103  *         virtual machine.
 104  *         </li>
 105  *     <li>Construct an MXBean proxy instance that forwards the
 106  *         method calls to a given {@link MBeanServer MBeanServer} by calling
 107  *         the {@link #getPlatformMXBean(MBeanServerConnection, Class)} or
 108  *         {@link #getPlatformMXBeans(MBeanServerConnection, Class)} method.
 109  *         The {@link #newPlatformMXBeanProxy newPlatformMXBeanProxy} method
 110  *         can also be used to construct an MXBean proxy instance of
 111  *         a given {@code ObjectName}.
 112  *         A proxy is typically constructed to remotely access
 113  *         an MXBean of another running virtual machine.
 114  *         </li>
 115  * </ul>
 116  * <h4>2. Indirect access to an MXBean interface via MBeanServer</h4>
 117  * <ul>
 118  *     <li>Go through the platform {@code MBeanServer} to access MXBeans
 119  *         locally or a specific {@code MBeanServerConnection} to access
 120  *         MXBeans remotely.
 121  *         The attributes and operations of an MXBean use only
 122  *         <em>JMX open types</em> which include basic data types,
 123  *         {@link javax.management.openmbean.CompositeData CompositeData},
 124  *         and {@link javax.management.openmbean.TabularData TabularData}
 125  *         defined in
 126  *         {@link javax.management.openmbean.OpenType OpenType}.
 127  *         The mapping is specified in
 128  *         the {@linkplain javax.management.MXBean MXBean} specification
 129  *         for details.
 130  *        </li>
 131  * </ul>
 132  * </blockquote>
 133  *
 134  * <p>
 135  * The {@link #getPlatformManagementInterfaces getPlatformManagementInterfaces}
 136  * method returns all management interfaces supported in the Java virtual machine


< prev index next >