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.Object
doGetAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, javax.management.MBeanAttributeInfo attributeInfo, java.lang.String attributeName)
static javax.management.MBeanAttributeInfo
findMBeanAttributeInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)
static java.lang.Object
getAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, java.lang.String attributeName)
static java.lang.Object
getAttribute(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName, javax.management.MBeanAttributeInfo attributeInfo)
static java.lang.management.ClassLoadingMXBean
getClassLoadingMXBean()
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 ofGarbageCollectorMXBean
objects in the Java virtual machine.static MBeanAttribute[]
getMBeanAttributes(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
Get theMBeanAttributes
from the specified named MBean and its' registeredMBeanServer
Note that the array ofMBeanAttributes
is the same order ofMBeanInfo.getAttributes()
static java.util.Map<java.lang.String,MBeanAttribute>
getMBeanAttributesMap(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
Get theMap
with the attribute name andMBeanAttributes
from the specified named MBean and its' registeredMBeanServer
static javax.management.MBeanInfo
getMBeanInfo(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
static java.util.List<java.lang.management.MemoryManagerMXBean>
getMemoryManagerMXBeans()
Returns a list ofMemoryManagerMXBean
objects in the Java virtual machine.static java.lang.management.MemoryMXBean
getMemoryMXBean()
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 ofMemoryPoolMXBean
objects in the Java virtual machine.static java.lang.management.OperatingSystemMXBean
getOperatingSystemMXBean()
Returns the managed bean for the operating system on which the Java virtual machine is running.static java.lang.management.RuntimeMXBean
getRuntimeMXBean()
Returns the managed bean for the runtime system of the Java virtual machine.static java.lang.management.ThreadMXBean
getThreadMXBean()
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
ClassLoadingMXBean
object 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
MemoryMXBean
object 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
ThreadMXBean
object 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
RuntimeMXBean
object 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 returnsnull
if the Java virtual machine has no compilation system.- Returns:
- an instance of
Optional
holding aCompilationMXBean
object 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
OperatingSystemMXBean
object for the Java virtual machine.
-
getMemoryPoolMXBeans
@Nonnull public static java.util.List<java.lang.management.MemoryPoolMXBean> getMemoryPoolMXBeans()
Returns a list ofMemoryPoolMXBean
objects 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
MemoryPoolMXBean
objects.
-
getMemoryManagerMXBeans
@Nonnull public static java.util.List<java.lang.management.MemoryManagerMXBean> getMemoryManagerMXBeans()
Returns a list ofMemoryManagerMXBean
objects 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
MemoryManagerMXBean
objects.
-
getGarbageCollectorMXBeans
@Nonnull public static java.util.List<java.lang.management.GarbageCollectorMXBean> getGarbageCollectorMXBeans()
Returns a list ofGarbageCollectorMXBean
objects in the Java virtual machine. The Java virtual machine may have one or moreGarbageCollectorMXBean
objects. It may add or removeGarbageCollectorMXBean
during execution.- Returns:
- a list of
GarbageCollectorMXBean
objects.
-
getMBeanAttributesMap
@Nonnull public static java.util.Map<java.lang.String,MBeanAttribute> getMBeanAttributesMap(javax.management.MBeanServer mBeanServer, javax.management.ObjectName objectName)
Get theMap
with the attribute name andMBeanAttributes
from the specified named MBean and its' registeredMBeanServer
- Parameters:
mBeanServer
-MBeanServer
objectName
- 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 theMBeanAttributes
from the specified named MBean and its' registeredMBeanServer
Note that the array ofMBeanAttributes
is the same order ofMBeanInfo.getAttributes()
- Parameters:
mBeanServer
-MBeanServer
objectName
- 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)
-
-