ManagementFactory class is a factory class for getting
managed beans for the Java platform.
This class consists of static methods each of which returns
one or more platform MXBeans representing
the management interface of a component of the Java virtual
machine.
A platform MXBean is a managed bean that conforms to the JMX Instrumentation Specification and only uses a set of basic data types. A JMX management application and the platform MBeanServer can interoperate without requiring classes for MXBean specific data types. The data types being transmitted between the JMX connector server and the connector client are open types and this allows interoperation across versions. See the specification of MXBeans for details.
Each platform MXBean is a PlatformManagedObject
and it has a unique
ObjectName for
registration in the platform MBeanServer as returned by
by the getObjectName
method.
An application can access a platform MXBean in the following ways:
getPlatformMXBean or
getPlatformMXBeans method
and access the MXBean locally in the running
virtual machine.
MBeanServer by calling
the getPlatformMXBean(MBeanServerConnection, Class) or
getPlatformMXBeans(MBeanServerConnection, Class) method.
The newPlatformMXBeanProxy method
can also be used to construct an MXBean proxy instance of
a given ObjectName.
A proxy is typically constructed to remotely access
an MXBean of another running virtual machine.
MBeanServer to access MXBeans
locally or a specific MBeanServerConnection to access
MXBeans remotely.
The attributes and operations of an MXBean use only
JMX open types which include basic data types,
CompositeData,
and TabularData
defined in
OpenType.
The mapping is specified in
the MXBean specification
for details.
The getPlatformManagementInterfaces
method returns all management interfaces supported in the Java virtual machine
including the standard management interfaces listed in the tables
below as well as the management interfaces extended by the JDK implementation.
A Java virtual machine has a single instance of the following management interfaces:
A Java virtual machine has zero or a single instance of the following management interfaces.
| Management Interface | ObjectName |
|---|---|
CompilationMXBean |
java. |
A Java virtual machine may have one or more instances of the following management interfaces.
| Management Interface | ObjectName |
|---|---|
GarbageCollectorMXBean |
java.,name=collector's name |
MemoryManagerMXBean |
java.,name=manager's name |
MemoryPoolMXBean |
java.,name=pool's name |
BufferPoolMXBean |
java.nio:type=BufferPool,name=pool name |
javax.management.MXBean
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CLASS_LOADING_MXBEAN_NAME
String representation of the
|
| public static final String | COMPILATION_MXBEAN_NAME
String representation of the
|
| public static final String | GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE
The domain name and the type key property in
the |
| public static final String | MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE
The domain name and the type key property in
the |
| public static final String | MEMORY_MXBEAN_NAME
String representation of the
|
| public static final String | MEMORY_POOL_MXBEAN_DOMAIN_TYPE
The domain name and the type key property in
the |
| private static final String | |
| public static final String | OPERATING_SYSTEM_MXBEAN_NAME
String representation of the
|
| private static MBeanServer | |
| public static final String | RUNTIME_MXBEAN_NAME
String representation of the
|
| public static final String | THREAD_MXBEAN_NAME
String representation of the
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| public static ClassLoadingMXBean | Returns: aClassLoadingMXBean object for
the Java virtual machine.Returns the managed bean for the class loading system of the Java virtual machine. |
| public static CompilationMXBean | Returns: aCompilationMXBean object for the Java virtual
machine or null if the Java virtual machine has
no compilation system.Returns the managed bean for the compilation system of the Java virtual machine. |
| public static List | Returns: a list ofGarbageCollectorMXBean objects.Returns a list of |
| public static List | Returns: a list ofMemoryManagerMXBean objects.Returns a list of |
| public static MemoryMXBean | Returns: aMemoryMXBean object for the Java virtual machine.Returns the managed bean for the memory system of the Java virtual machine. |
| public static List | Returns: a list ofMemoryPoolMXBean objects.Returns a list of |
| public static OperatingSystemMXBean | Returns: anOperatingSystemMXBean object for
the Java virtual machine.Returns the managed bean for the operating system on which the Java virtual machine is running. |
| public static Set | Returns: the set ofClass objects, subinterface of
PlatformManagedObject representing
the management interfaces for
monitoring and managing the Java platform.Returns the set of |
| public static synchronized MBeanServer | Returns: the platformMBeanServer; the platform
MXBeans are registered into the platform MBeanServer
at the first time this method is called.Returns the platform |
| public static < an T extends PlatformManagedObject> TmxbeanInterface type parameter | Returns: the platform MXBean that implementsmxbeanInterface, or null if not exist.a management interface for a platform
MXBean with one single instance in the Java virtual machine
if implemented. mxbeanInterface)Returns the platform MXBean implementing
the given |
| public static < an T extends PlatformManagedObject> TmxbeanInterface type parameter | Returns: the platform MXBean proxy for forwarding the method calls of themxbeanInterface
through the given MBeanServerConnection,
or null if not exist.the connection, Class<T> MBeanServerConnection to forward to.a management interface for a platform
MXBean with one single instance in the Java virtual machine
being monitored, if implemented. mxbeanInterface)Returns the platform MXBean proxy for
|
| public static < an T extends PlatformManagedObject> ListmxbeanInterface type parameter | Returns: the list of platform MXBeans that implementmxbeanInterface.a management interface for a platform
MXBean mxbeanInterface)Returns the list of platform MXBeans implementing
the given |
| public static < an T extends PlatformManagedObject> ListmxbeanInterface type parameter | Returns: the list of platform MXBean proxies for forwarding the method calls of themxbeanInterface
through the given MBeanServerConnection.the connection, Class<T> MBeanServerConnection to forward to.a management interface for a platform
MXBean mxbeanInterface)Returns the list of the platform MXBean proxies for
forwarding the method calls of the |
| private static Stream | getProxyNames(PlatformMBeanProvider.
|
| public static RuntimeMXBean | Returns: aRuntimeMXBean object for the Java virtual machine.Returns the managed bean for the runtime system of the Java virtual machine. |
| public static ThreadMXBean | Returns: aThreadMXBean object for the Java virtual machine.Returns the managed bean for the thread system of the Java virtual machine. |
| private static boolean | |
| private static void | |
| public static < an T> TmxbeanInterface type parameter | Returns: a proxy for a platform MXBean interface of a given MXBean name that forwards its method calls through the givenMBeanServerConnection, or null if not exist.the connection, String MBeanServerConnection to forward to.the name of a platform MXBean within
mxbeanName, Class<T> connection to forward to. mxbeanName must be
in the format of ObjectName.the MXBean interface to be implemented
by the proxy. mxbeanInterface)Returns a proxy for a platform MXBean interface of a
given MXBean name
that forwards its method calls through the given
|
| private static Collection |
| CLASS_LOADING_MXBEAN_NAME | back to summary |
|---|---|
| public static final String CLASS_LOADING_MXBEAN_NAME String representation of the
| |
| COMPILATION_MXBEAN_NAME | back to summary |
|---|---|
| public static final String COMPILATION_MXBEAN_NAME String representation of the
| |
| GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE | back to summary |
|---|---|
| public static final String GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE The domain name and the type key property in
the | |
| MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE | back to summary |
|---|---|
| public static final String MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE The domain name and the type key property in
the | |
| MEMORY_MXBEAN_NAME | back to summary |
|---|---|
| public static final String MEMORY_MXBEAN_NAME String representation of the
| |
| MEMORY_POOL_MXBEAN_DOMAIN_TYPE | back to summary |
|---|---|
| public static final String MEMORY_POOL_MXBEAN_DOMAIN_TYPE The domain name and the type key property in
the | |
| NOTIF_EMITTER | back to summary |
|---|---|
| private static final String NOTIF_EMITTER | |
| OPERATING_SYSTEM_MXBEAN_NAME | back to summary |
|---|---|
| public static final String OPERATING_SYSTEM_MXBEAN_NAME String representation of the
| |
| platformMBeanServer | back to summary |
|---|---|
| private static MBeanServer platformMBeanServer | |
| RUNTIME_MXBEAN_NAME | back to summary |
|---|---|
| public static final String RUNTIME_MXBEAN_NAME String representation of the
| |
| THREAD_MXBEAN_NAME | back to summary |
|---|---|
| public static final String THREAD_MXBEAN_NAME String representation of the
| |
| ManagementFactory | back to summary |
|---|---|
| private ManagementFactory() | |
| addMXBean | back to summary |
|---|---|
| private static void addMXBean(final MBeanServer mbs, String name, final Object pmo) | |
| getClassLoadingMXBean | back to summary |
|---|---|
| public static ClassLoadingMXBean getClassLoadingMXBean() Returns the managed bean for the class loading system of the Java virtual machine.
| |
| getCompilationMXBean | back to summary |
|---|---|
| public static CompilationMXBean getCompilationMXBean() Returns the managed bean for the compilation system of
the Java virtual machine. This method returns
| |
| getGarbageCollectorMXBeans | back to summary |
|---|---|
| public static List Returns a list of
| |
| getMemoryManagerMXBeans | back to summary |
|---|---|
| public static List Returns a list of
| |
| getMemoryMXBean | back to summary |
|---|---|
| public static MemoryMXBean getMemoryMXBean() Returns the managed bean for the memory system of the Java virtual machine.
| |
| getMemoryPoolMXBeans | back to summary |
|---|---|
| public static List Returns a list of
| |
| getOperatingSystemMXBean | back to summary |
|---|---|
| public static OperatingSystemMXBean getOperatingSystemMXBean() Returns the managed bean for the operating system on which the Java virtual machine is running.
| |
| getPlatformManagementInterfaces | back to summary |
|---|---|
| public static Set Returns the set of
| |
| getPlatformMBeanServer | back to summary |
|---|---|
| public static synchronized MBeanServer getPlatformMBeanServer() Returns the platform
MXBeans that get created and destroyed dynamically, for example,
memory
If the system property
It is recommended that this platform MBeanServer also be used
to register other application managed beans
besides the platform MXBeans.
This will allow all MBeans to be published through the same
| |
| getPlatformMXBean | back to summary |
|---|---|
| public static <T extends PlatformManagedObject> T getPlatformMXBean(Class<T> mxbeanInterface) Returns the platform MXBean implementing
the given
| |
| getPlatformMXBean | back to summary |
|---|---|
| public static <T extends PlatformManagedObject> T getPlatformMXBean(MBeanServerConnection connection, Class<T> mxbeanInterface) throws IOException Returns the platform MXBean proxy for
| |
| getPlatformMXBeans | back to summary |
|---|---|
| public static <T extends PlatformManagedObject> List Returns the list of platform MXBeans implementing
the given
| |
| getPlatformMXBeans | back to summary |
|---|---|
| public static <T extends PlatformManagedObject> List Returns the list of the platform MXBean proxies for
forwarding the method calls of the
| |
| getProxyNames | back to summary |
|---|---|
| private static Stream | |
| getRuntimeMXBean | back to summary |
|---|---|
| public static RuntimeMXBean getRuntimeMXBean() Returns the managed bean for the runtime system of the Java virtual machine.
| |
| getThreadMXBean | back to summary |
|---|---|
| public static ThreadMXBean getThreadMXBean() Returns the managed bean for the thread system of the Java virtual machine.
| |
| isInstanceOf | back to summary |
|---|---|
| private static boolean isInstanceOf(MBeanServerConnection connection, ObjectName objName, String intfName) throws InstanceNotFoundException, IOException | |
| loadNativeLib | back to summary |
|---|---|
private static void loadNativeLib()
| |
| newPlatformMXBeanProxy | back to summary |
|---|---|
| public static <T> T newPlatformMXBeanProxy(MBeanServerConnection connection, String mxbeanName, Class<T> mxbeanInterface) throws IOException Returns a proxy for a platform MXBean interface of a
given MXBean name
that forwards its method calls through the given
This method is equivalent to: where handler is an InvocationHandler to which method invocations to the MXBean interface
are dispatched. This handler converts an input parameter
from an MXBean data type to its mapped open type before forwarding
to the MBeanServer and converts a return value from
an MXBean method call through the MBeanServer
from an open type to the corresponding return type declared in
the MXBean interface.
If the MXBean is a notification emitter (i.e.,
it implements
Notes:
| |
| platformComponents | back to summary |
|---|---|
| private static Collection | |
| Modifier and Type | Field and Description |
|---|---|
| private static final Map |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static PlatformMBeanProvider. | |
| pack-priv static PlatformMBeanProvider. | |
| pack-priv static Map |
| componentMap | back to summary |
|---|---|
| private static final Map<String, PlatformMBeanProvider. | |
| PlatformMBeanFinder | back to summary |
|---|---|
| private PlatformMBeanFinder() | |
| findFirst | back to summary |
|---|---|
| pack-priv static PlatformMBeanProvider. | |
| findSingleton | back to summary |
|---|---|
| pack-priv static PlatformMBeanProvider. | |
| getMap | back to summary |
|---|---|
| pack-priv static Map | |