The 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:
- Get an MXBean instance by calling the
getPlatformMXBeanorgetPlatformMXBeansmethod and access the MXBean locally in the running virtual machine.- Construct an MXBean proxy instance that forwards the method calls to a given
MBeanServerby calling thegetPlatformMXBean(MBeanServerConnection, Class)orgetPlatformMXBeans(MBeanServerConnection, Class)method. ThenewPlatformMXBeanProxymethod can also be used to construct an MXBean proxy instance of a givenObjectName. A proxy is typically constructed to remotely access an MXBean of another running virtual machine.2. Indirect access to an MXBean interface via MBeanServer
- Go through the platform
MBeanServerto 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, andTabularDatadefined inOpenType. 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 CompilationMXBeanjava.lang:type=Compilation
A Java virtual machine may have one or more instances of the following management interfaces.
Management Interface ObjectName GarbageCollectorMXBeanjava.lang:type=GarbageCollector,name=collector's nameMemoryManagerMXBeanjava.lang:type=MemoryManager,name=manager's nameMemoryPoolMXBeanjava.lang:type=MemoryPool,name=pool's nameBufferPoolMXBeanjava.nio:type=BufferPool,name=pool name
JMX Specification,
Ways to Access Management Metrics, javax.management.MXBean