APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.management

public Class ManagementFactoryHelper

extends Object
Class Inheritance
Imports
java.lang.invoke.MethodHandles, java.lang.management.*, java.lang.reflect.InvocationTargetException, .Method, .UndeclaredThrowableException, javax.management.InstanceAlreadyExistsException, .InstanceNotFoundException, .MBeanServer, .MBeanRegistrationException, .NotCompliantMBeanException, .ObjectName, .RuntimeOperationsException, jdk.internal.misc.VM, .VM.BufferPool, java.util.ArrayList, .List, .Arrays, .Collections, .HashMap, .Map, .Optional, java.util.stream.Collectors

ManagementFactoryHelper provides static factory methods to create instances of the management interface.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final String
private static volatile List<BufferPoolMXBean>
private static ClassLoadingImpl
private static CompilationImpl
private static final String
private static final String
private static final String
private static final String
private static final String
private static HotspotClassLoading
private static HotspotCompilation
private static HotspotMemory
private static HotspotRuntime
private static HotspotThread
private static final int
private static final int
private static final int
private static final VMManagement
pack-priv static final String
private static MemoryImpl
private static BaseOperatingSystemImpl
private static RuntimeImpl
private static ThreadImpl

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
addMBean(MBeanServer mbs, Object mbean, String mbeanName)

Registers a given MBean if not registered in the MBeanServer; otherwise, just return.

private static BufferPoolMXBean
createBufferPoolMXBean(final VM.BufferPool pool)

Creates management interface for the given buffer pool.

private static GarbageCollectorMXBean
private static MemoryManagerMXBean
private static MemoryPoolMXBean
createMemoryPool(String name, boolean isHeap, long uThreshold, long gcThreshold)

public static String[]
getAllMemoryPoolNames()

Returns an array of the name of all memory pools.

public static List<BufferPoolMXBean>
public static synchronized ClassLoadingMXBean
public static synchronized CompilationMXBean
public static List<GarbageCollectorMXBean>
public static synchronized HotspotClassLoadingMBean
getHotspotClassLoadingMBean()

This method is for testing only.

public static synchronized HotspotCompilationMBean
getHotspotCompilationMBean()

This method is for testing only.

public static synchronized HotspotMemoryMBean
getHotspotMemoryMBean()

This method is for testing only.

public static synchronized HotspotRuntimeMBean
getHotspotRuntimeMBean()

This method is for testing only.

public static synchronized HotspotThreadMBean
getHotspotThreadMBean()

This method is for testing only.

public static List<MemoryManagerMXBean>
public static synchronized MemoryMXBean
public static List<MemoryPoolMXBean>
public static synchronized OperatingSystemMXBean
public static PlatformLoggingMXBean
public static synchronized RuntimeMXBean
public static synchronized ThreadMXBean
public static VMManagement
public static boolean
public static boolean
public static boolean
isThreadSuspended(int state)

pack-priv static void
public static Thread.State
toThreadState(int state)

pack-priv static void
private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUFFER_POOL_MXBEAN_NAMEback to summary
private static final String BUFFER_POOL_MXBEAN_NAME
bufferPoolsback to summary
private static volatile List<BufferPoolMXBean> bufferPools
classMBeanback to summary
private static ClassLoadingImpl classMBean
compileMBeanback to summary
private static CompilationImpl compileMBean
HOTSPOT_CLASS_LOADING_MBEAN_NAMEback to summary
private static final String HOTSPOT_CLASS_LOADING_MBEAN_NAME
HOTSPOT_COMPILATION_MBEAN_NAMEback to summary
private static final String HOTSPOT_COMPILATION_MBEAN_NAME
HOTSPOT_MEMORY_MBEAN_NAMEback to summary
private static final String HOTSPOT_MEMORY_MBEAN_NAME
HOTSPOT_RUNTIME_MBEAN_NAMEback to summary
private static final String HOTSPOT_RUNTIME_MBEAN_NAME
HOTSPOT_THREAD_MBEAN_NAMEback to summary
private static final String HOTSPOT_THREAD_MBEAN_NAME
hsClassMBeanback to summary
private static HotspotClassLoading hsClassMBean
hsCompileMBeanback to summary
private static HotspotCompilation hsCompileMBean
hsMemoryMBeanback to summary
private static HotspotMemory hsMemoryMBean
hsRuntimeMBeanback to summary
private static HotspotRuntime hsRuntimeMBean
hsThreadMBeanback to summary
private static HotspotThread hsThreadMBean
JMM_THREAD_STATE_FLAG_MASKback to summary
private static final int JMM_THREAD_STATE_FLAG_MASK
JMM_THREAD_STATE_FLAG_NATIVEback to summary
private static final int JMM_THREAD_STATE_FLAG_NATIVE
JMM_THREAD_STATE_FLAG_SUSPENDEDback to summary
private static final int JMM_THREAD_STATE_FLAG_SUSPENDED
jvmback to summary
private static final VMManagement jvm
LOGGING_MXBEAN_NAMEback to summary
pack-priv static final String LOGGING_MXBEAN_NAME
memoryMBeanback to summary
private static MemoryImpl memoryMBean
osMBeanback to summary
private static BaseOperatingSystemImpl osMBean
runtimeMBeanback to summary
private static RuntimeImpl runtimeMBean
threadMBeanback to summary
private static ThreadImpl threadMBean

Constructor Detail

ManagementFactoryHelperback to summary
private ManagementFactoryHelper()

Method Detail

addMBeanback to summary
private static void addMBean(MBeanServer mbs, Object mbean, String mbeanName)

Registers a given MBean if not registered in the MBeanServer; otherwise, just return.

createBufferPoolMXBeanback to summary
private static BufferPoolMXBean createBufferPoolMXBean(final VM.BufferPool pool)

Creates management interface for the given buffer pool.

createGarbageCollectorback to summary
private static GarbageCollectorMXBean createGarbageCollector(String name, String type)
createMemoryManagerback to summary
private static MemoryManagerMXBean createMemoryManager(String name)
createMemoryPoolback to summary
private static MemoryPoolMXBean createMemoryPool(String name, boolean isHeap, long uThreshold, long gcThreshold)
getAllMemoryPoolNamesback to summary
public static String[] getAllMemoryPoolNames()

Returns an array of the name of all memory pools. The order of the memory pools is significant and maintained in the VM.

getBufferPoolMXBeansback to summary
public static List<BufferPoolMXBean> getBufferPoolMXBeans()
getClassLoadingMXBeanback to summary
public static synchronized ClassLoadingMXBean getClassLoadingMXBean()
getCompilationMXBeanback to summary
public static synchronized CompilationMXBean getCompilationMXBean()
getGarbageCollectorMXBeansback to summary
public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans()
getHotspotClassLoadingMBeanback to summary
public static synchronized HotspotClassLoadingMBean getHotspotClassLoadingMBean()

This method is for testing only.

getHotspotCompilationMBeanback to summary
public static synchronized HotspotCompilationMBean getHotspotCompilationMBean()

This method is for testing only.

getHotspotMemoryMBeanback to summary
public static synchronized HotspotMemoryMBean getHotspotMemoryMBean()

This method is for testing only.

getHotspotRuntimeMBeanback to summary
public static synchronized HotspotRuntimeMBean getHotspotRuntimeMBean()

This method is for testing only.

getHotspotThreadMBeanback to summary
public static synchronized HotspotThreadMBean getHotspotThreadMBean()

This method is for testing only.

getMemoryManagerMXBeansback to summary
public static List<MemoryManagerMXBean> getMemoryManagerMXBeans()
getMemoryMXBeanback to summary
public static synchronized MemoryMXBean getMemoryMXBean()
getMemoryPoolMXBeansback to summary
public static List<MemoryPoolMXBean> getMemoryPoolMXBeans()
getOperatingSystemMXBeanback to summary
public static synchronized OperatingSystemMXBean getOperatingSystemMXBean()
getPlatformLoggingMXBeanback to summary
public static PlatformLoggingMXBean getPlatformLoggingMXBean()
getRuntimeMXBeanback to summary
public static synchronized RuntimeMXBean getRuntimeMXBean()
getThreadMXBeanback to summary
public static synchronized ThreadMXBean getThreadMXBean()
getVMManagementback to summary
public static VMManagement getVMManagement()
isPlatformLoggingMXBeanAvailableback to summary
public static boolean isPlatformLoggingMXBeanAvailable()
isThreadRunningNativeback to summary
public static boolean isThreadRunningNative(int state)
isThreadSuspendedback to summary
public static boolean isThreadSuspended(int state)
registerInternalMBeansback to summary
pack-priv static void registerInternalMBeans(MBeanServer mbs)
toThreadStateback to summary
public static Thread.State toThreadState(int state)
unregisterInternalMBeansback to summary
pack-priv static void unregisterInternalMBeans(MBeanServer mbs)
unregisterMBeanback to summary
private static void unregisterMBean(MBeanServer mbs, String mbeanName)
sun.management back to summary

pack-priv final Class ManagementFactoryHelper.LoggingMXBeanAccess

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final Object
pack-priv static final Class<?>
pack-priv static final String
pack-priv static final String
pack-priv final Map<String, Method>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private static Object
private Map<String, Method>
pack-priv <T> T
invoke(String methodName, Object... args)

pack-priv static boolean
private static Class<?>
private static RuntimeException
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implback to summary
pack-priv final Object impl
LOG_MANAGER_CLASSback to summary
pack-priv static final Class<?> LOG_MANAGER_CLASS
LOG_MANAGER_CLASS_NAMEback to summary
pack-priv static final String LOG_MANAGER_CLASS_NAME
LOGGING_MXBEAN_CLASS_NAMEback to summary
pack-priv static final String LOGGING_MXBEAN_CLASS_NAME
methodsback to summary
pack-priv final Map<String, Method> methods

Constructor Detail

LoggingMXBeanAccessback to summary
pack-priv LoggingMXBeanAccess()

Method Detail

getMXBeanImplementationback to summary
private static Object getMXBeanImplementation()
initMethodMapback to summary
private Map<String, Method> initMethodMap(Object impl)
invokeback to summary
pack-priv <T> T invoke(String methodName, Object... args)
isAvailableback to summary
pack-priv static boolean isAvailable()
loadLoggingClassback to summary
private static Class<?> loadLoggingClass(String className)
unwrapback to summary
private static RuntimeException unwrap(InvocationTargetException x)
sun.management back to summary

pack-priv final Class ManagementFactoryHelper.PlatformLoggingImpl

extends Object
implements PlatformLoggingMXBean
Class Inheritance
All Implemented Interfaces
java.lang.management.PlatformLoggingMXBean, java.lang.management.PlatformManagedObject

Field Summary

Modifier and TypeField and Description
private final ManagementFactoryHelper.LoggingMXBeanAccess
pack-priv static final PlatformLoggingMXBean
private volatile ObjectName

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static ManagementFactoryHelper.PlatformLoggingImpl
public String
getLoggerLevel(String loggerName)

Implements java.lang.management.PlatformLoggingMXBean.getLoggerLevel.

Gets the name of the log level associated with the specified logger.

public List<String>
getLoggerNames()

Implements java.lang.management.PlatformLoggingMXBean.getLoggerNames.

Returns the list of the currently registered logger names.

public ObjectName
getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

public String
getParentLoggerName(String loggerName)

Implements java.lang.management.PlatformLoggingMXBean.getParentLoggerName.

Returns the name of the parent for the specified logger.

public void
setLoggerLevel(String loggerName, String levelName)

Implements java.lang.management.PlatformLoggingMXBean.setLoggerLevel.

Sets the specified logger to the specified new level.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggingAccessback to summary
private final ManagementFactoryHelper.LoggingMXBeanAccess loggingAccess
MBEANback to summary
pack-priv static final PlatformLoggingMXBean MBEAN
objnameback to summary
private volatile ObjectName objname

Constructor Detail

PlatformLoggingImplback to summary
private PlatformLoggingImpl(ManagementFactoryHelper.LoggingMXBeanAccess loggingAccess)

Method Detail

getInstanceback to summary
private static ManagementFactoryHelper.PlatformLoggingImpl getInstance()
getLoggerLevelback to summary
public String getLoggerLevel(String loggerName)

Implements java.lang.management.PlatformLoggingMXBean.getLoggerLevel.

Doc from java.lang.management.PlatformLoggingMXBean.getLoggerLevel.

Gets the name of the log level associated with the specified logger. If the specified logger does not exist, null is returned. This method first finds the logger of the given name and then returns the name of the log level by calling:

Logger.getLevel().getName();

If the Level of the specified logger is null, which means that this logger's effective level is inherited from its parent, an empty string will be returned.

Annotations
@Override
getLoggerNamesback to summary
public List<String> getLoggerNames()

Implements java.lang.management.PlatformLoggingMXBean.getLoggerNames.

Doc from java.lang.management.PlatformLoggingMXBean.getLoggerNames.

Returns the list of the currently registered logger names. This method calls java.logging/java.util.logging.LogManager#getLoggerNames and returns a list of the logger names.

Annotations
@Override
getObjectNameback to summary
public ObjectName getObjectName()

Implements java.lang.management.PlatformManagedObject.getObjectName.

Doc from java.lang.management.PlatformManagedObject.getObjectName.

Returns an ObjectName instance representing the object name of this platform managed object.

Annotations
@Override
getParentLoggerNameback to summary
public String getParentLoggerName(String loggerName)

Implements java.lang.management.PlatformLoggingMXBean.getParentLoggerName.

Doc from java.lang.management.PlatformLoggingMXBean.getParentLoggerName.

Returns the name of the parent for the specified logger. If the specified logger does not exist, null is returned. If the specified logger is the root Logger in the namespace, the result will be an empty string.

Annotations
@Override
setLoggerLevelback to summary
public void setLoggerLevel(String loggerName, String levelName)

Implements java.lang.management.PlatformLoggingMXBean.setLoggerLevel.

Doc from java.lang.management.PlatformLoggingMXBean.setLoggerLevel.

Sets the specified logger to the specified new level. If the levelName is not null, the level of the specified logger is set to the parsed Level matching the levelName. If the levelName is null, the level of the specified logger is set to null and the effective level of the logger is inherited from its nearest ancestor with a specific (non-null) level value.

Annotations
@Override