See:
Description
Interface Summary | |
---|---|
ClassLoadingMBean | The management interface for the class loading system of the Java virtual machine. |
CompilationMBean | The management interface for the compilation system of the Java virtual machine. |
GarbageCollectorMBean | The management interface for the garbage collection of the Java virtual machine. |
MemoryManagerMBean | The management interface for a memory manager. |
MemoryMBean | The management interface for the memory system of the Java virtual machine. |
MemoryPoolMBean | The management interface for a memory pool. |
OperatingSystemMBean | The management interface for the operating system on which the Java virtual machine is running. |
RuntimeMBean | The management interface for the runtime system of the Java virtual machine. |
ThreadMBean | The management interface for the thread system of the Java virtual machine. |
Class Summary | |
---|---|
ManagementFactory | ManagementFactory class is a factory class for getting managed beans for the Java platform. |
ManagementPermission | The permission which the SecurityManager will check when code that is running with a SecurityManager calls methods defined in the management interface for the Java platform. |
MemoryNotification | A memory notification emitted by MemoryMBean
indicating that the Java virtual machine detects that the memory
usage of a memory pool is crossing a threshold value. |
MemoryUsage | A MemoryUsage object represents a snapshot of memory usage. |
ThreadInfo | Thread information. |
Enum Summary | |
---|---|
MemoryType | Types of memory pools . |
ThreadState | Possible states of a thread running in the Java virtual machine. |
Provides the management interface for monitoring and management of the Java virtual machine as well as the operating system on which the Java virtual machine is running. It allows both local and remote monitoring and management of the running Java virtual machine.
Management Interface Description ClassLoadingMBean
Class loading system of the Java virtual machine. CompilationMBean
Compilation system of the Java virtual machine. MemoryMBean
Memory system of the Java virtual machine. ThreadMBean
Threads system of the Java virtual machine. RuntimeMBean
Runtime system of the Java virtual machine. OperatingSystemMBean
Operating system on which the Java virtual machine is running. GarbageCollectorMBean
Garbage collector in the Java virtual machine. MemoryManagerMBean
Memory manager in the Java virtual machine. MemoryPoolMBean
Memory pool in the Java virtual machine.
The object that implements the management interface is a managed bean (MBean) that conforms to the JMX Instrumentation Specification. An application can monitor the instrumentation of the Java virtual machine and manage certain characteristics in any of the following ways:
MBeanServer
.MBean proxy
and call the methods of the MBean proxy.ManagementFactory
class is the management
factory class for the Java platform. This class provides a set of
static factory methods to obtain the MBeans for the Java platform
to allow an application to access the MBeans directly.
This class provides the
ManagementFactory.getPlatformMBeanServer()
method to create the platform MBeanServer and register
all platform MBeans into the platform MBeanServer.
Each MBean is registered with a unique defined
ObjectName
.
RuntimeMBean mbean = ManagementFactory.getRuntimeMBean(); // Get the standard attribute "VmVendor" String vendor = mbean.getVmVendor();
MBeanServerConnection mbs; // Connect to a running JVM (or itself) and get MBeanServerConnection // that has the JVM MBeans registered in it ... try { // Assuming the RuntimeMBean has been registered in mbs ObjectName oname = new ObjectName(MBeanNames.RUNTIME_MBEAN); // Get standard attribute "VmVendor" String vendor = (String) mbs.getAttribute(oname, "VmVendor"); } catch (....) { // Catch the exceptions thrown by ObjectName constructor // and MBeanServer.getAttribute method ... }
MBeanServerConnection mbs; // Connect to a running JVM (or itself) and get MBeanServerConnection // that has the JVM MBeans registered in it ... // Assuming the RuntimeMBean has been registered in mbs ObjectName oname = new ObjectName(MBeanNames.RUNTIME_MBEAN); // Get a MBean proxy for RuntimeMBean interface RuntimeMBean proxy = (RuntimeMBean) MBeanServerInvocationHandler.newProxyInstance(mbs, oname, RuntimeMBean.class, false); // Get standard attribute "VmVendor" String vendor = proxy.getVmVendor();
Unless otherwise noted, passing a null argument to a constructor
or method in any class or interface in this package will cause a NullPointerException
to be thrown.