Package io.microsphere.management
Class JmxUtils
- java.lang.Object
-
- io.microsphere.management.JmxUtils
-
-
Field Summary
Fields Modifier and Type Field Description static MBeanAttribute[]EMPTY_MBEAN_ATTRIBUTE_ARRAY
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static java.lang.ObjectdoGetAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, javax.management.MBeanAttributeInfo attributeInfo, java.lang.String attributeName)static javax.management.MBeanAttributeInfofindMBeanAttributeInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)static java.lang.ObjectgetAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)static java.lang.ObjectgetAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, javax.management.MBeanAttributeInfo attributeInfo)static java.lang.management.ClassLoadingMXBeangetClassLoadingMXBean()Returns the managed bean for the class loading system of the Java virtual machine.static java.util.Optional<java.lang.management.CompilationMXBean>getCompilationMXBean()Returns the managed bean for the compilation system of the Java virtual machine.static java.util.List<java.lang.management.GarbageCollectorMXBean>getGarbageCollectorMXBeans()Returns a list ofGarbageCollectorMXBeanobjects in the Java virtual machine.static MBeanAttribute[]getMBeanAttributes(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)Get theMBeanAttributesfrom the specified named MBean and its' registeredMBeanServerNote that the array ofMBeanAttributesis the same order ofMBeanInfo.getAttributes()static java.util.Map<java.lang.String,MBeanAttribute>getMBeanAttributesMap(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)Get theMapwith the attribute name andMBeanAttributesfrom the specified named MBean and its' registeredMBeanServerstatic javax.management.MBeanInfogetMBeanInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)static java.util.List<java.lang.management.MemoryManagerMXBean>getMemoryManagerMXBeans()Returns a list ofMemoryManagerMXBeanobjects in the Java virtual machine.static java.lang.management.MemoryMXBeangetMemoryMXBean()Returns the managed bean for the memory system of the Java virtual machine.static java.util.List<java.lang.management.MemoryPoolMXBean>getMemoryPoolMXBeans()Returns a list ofMemoryPoolMXBeanobjects in the Java virtual machine.static java.lang.management.OperatingSystemMXBeangetOperatingSystemMXBean()Returns the managed bean for the operating system on which the Java virtual machine is running.static java.lang.management.RuntimeMXBeangetRuntimeMXBean()Returns the managed bean for the runtime system of the Java virtual machine.static java.lang.management.ThreadMXBeangetThreadMXBean()Returns the managed bean for the thread system of the Java virtual machine.
-
-
-
Field Detail
-
EMPTY_MBEAN_ATTRIBUTE_ARRAY
public static final MBeanAttribute[] EMPTY_MBEAN_ATTRIBUTE_ARRAY
-
-
Method Detail
-
getClassLoadingMXBean
@Nonnull public static java.lang.management.ClassLoadingMXBean getClassLoadingMXBean()
Returns the managed bean for the class loading system of the Java virtual machine.- Returns:
- a
ClassLoadingMXBeanobject for the Java virtual machine.
-
getMemoryMXBean
@Nonnull public static java.lang.management.MemoryMXBean getMemoryMXBean()
Returns the managed bean for the memory system of the Java virtual machine.- Returns:
- a
MemoryMXBeanobject for the Java virtual machine.
-
getThreadMXBean
@Nonnull public static java.lang.management.ThreadMXBean getThreadMXBean()
Returns the managed bean for the thread system of the Java virtual machine.- Returns:
- a
ThreadMXBeanobject for the Java virtual machine.
-
getRuntimeMXBean
@Nonnull public static java.lang.management.RuntimeMXBean getRuntimeMXBean()
Returns the managed bean for the runtime system of the Java virtual machine.- Returns:
- a
RuntimeMXBeanobject for the Java virtual machine.
-
getCompilationMXBean
@Nullable public static java.util.Optional<java.lang.management.CompilationMXBean> getCompilationMXBean()
Returns the managed bean for the compilation system of the Java virtual machine. This method returnsnullif the Java virtual machine has no compilation system.- Returns:
- an instance of
Optionalholding aCompilationMXBeanobject for the Java virtual machine or {@code null if the Java virtual machine has no compilation system.
-
getOperatingSystemMXBean
@Nonnull public static java.lang.management.OperatingSystemMXBean getOperatingSystemMXBean()
Returns the managed bean for the operating system on which the Java virtual machine is running.- Returns:
- an
OperatingSystemMXBeanobject for the Java virtual machine.
-
getMemoryPoolMXBeans
@Nonnull public static java.util.List<java.lang.management.MemoryPoolMXBean> getMemoryPoolMXBeans()
Returns a list ofMemoryPoolMXBeanobjects in the Java virtual machine. The Java virtual machine can have one or more memory pools. It may add or remove memory pools during execution.- Returns:
- a list of
MemoryPoolMXBeanobjects.
-
getMemoryManagerMXBeans
@Nonnull public static java.util.List<java.lang.management.MemoryManagerMXBean> getMemoryManagerMXBeans()
Returns a list ofMemoryManagerMXBeanobjects in the Java virtual machine. The Java virtual machine can have one or more memory managers. It may add or remove memory managers during execution.- Returns:
- a list of
MemoryManagerMXBeanobjects.
-
getGarbageCollectorMXBeans
@Nonnull public static java.util.List<java.lang.management.GarbageCollectorMXBean> getGarbageCollectorMXBeans()
Returns a list ofGarbageCollectorMXBeanobjects in the Java virtual machine. The Java virtual machine may have one or moreGarbageCollectorMXBeanobjects. It may add or removeGarbageCollectorMXBeanduring execution.- Returns:
- a list of
GarbageCollectorMXBeanobjects.
-
getMBeanAttributesMap
@Nonnull public static java.util.Map<java.lang.String,MBeanAttribute> getMBeanAttributesMap(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
Get theMapwith the attribute name andMBeanAttributesfrom the specified named MBean and its' registeredMBeanServer- Parameters:
mBeanServer-MBeanServerobjectName- the name of MBean- Returns:
- non-null read-only
Map
-
getMBeanAttributes
@Nonnull public static MBeanAttribute[] getMBeanAttributes(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
Get theMBeanAttributesfrom the specified named MBean and its' registeredMBeanServerNote that the array ofMBeanAttributesis the same order ofMBeanInfo.getAttributes()- Parameters:
mBeanServer-MBeanServerobjectName- the name of MBean- Returns:
- non-null array
-
getAttribute
public static java.lang.Object getAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, javax.management.MBeanAttributeInfo attributeInfo)
-
getAttribute
public static java.lang.Object getAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)
-
findMBeanAttributeInfo
public static javax.management.MBeanAttributeInfo findMBeanAttributeInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)
-
doGetAttribute
protected static java.lang.Object doGetAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, @Nullable javax.management.MBeanAttributeInfo attributeInfo, java.lang.String attributeName)
-
getMBeanInfo
public static javax.management.MBeanInfo getMBeanInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
-
-