javan之ManagementFactory
来源:互联网 发布:gps数据导入,导出 编辑:程序博客网 时间:2024/06/06 01:23
* Returns the platform MXBean implementing
* the given {@code mxbeanInterface} which is specified
* to have one single instance in the Java virtual machine.
* This method may return {@code null} if the management interface
* is not implemented in the Java virtual machine (for example,
* a Java virtual machine with no compilation system does not
* implement {@link CompilationMXBean});
* otherwise, this method is equivalent to calling:
* <pre>
* {@link #getPlatformMXBeans(Class)
* getPlatformMXBeans(mxbeanInterface)}.get(0);
* </pre>
*
* @param mxbeanInterface a management interface for a platform
* MXBean with one single instance in the Java virtual machine
* if implemented.
*
* @return the platform MXBean that implements
* {@code mxbeanInterface}, or {@code null} if not exist.
*
* @throws IllegalArgumentException if {@code mxbeanInterface}
* is not a platform management interface or
* not a singleton platform MXBean.
*
* @since 1.7
*/
public static <T extends PlatformManagedObject>
T getPlatformMXBean(Class<T> mxbeanInterface) {
PlatformComponent pc = PlatformComponent.getPlatformComponent(mxbeanInterface);
if (pc == null)
throw new IllegalArgumentException(mxbeanInterface.getName() +
" is not a platform management interface");
if (!pc.isSingleton())
throw new IllegalArgumentException(mxbeanInterface.getName() +
" can have zero or more than one instances");
return pc.getSingletonMXBean(mxbeanInterface);
}
/**
* Returns the managed bean for the memory system of
* the Java virtual machine.
*
* @return a {@link MemoryMXBean} object for the Java virtual machine.
*/
public static MemoryMXBean getMemoryMXBean() {
return ManagementFactoryHelper.getMemoryMXBean();
}
/**
* Returns the managed bean for the thread system of
* the Java virtual machine.
*
* @return a {@link ThreadMXBean} object for the Java virtual machine.
*/
public static ThreadMXBean getThreadMXBean() {
return ManagementFactoryHelper.getThreadMXBean();
}
/**
* Returns a list of {@link GarbageCollectorMXBean} objects
* in the Java virtual machine.
* The Java virtual machine may have one or more
* <tt>GarbageCollectorMXBean</tt> objects.
* It may add or remove <tt>GarbageCollectorMXBean</tt>
* during execution.
*
* @return a list of <tt>GarbageCollectorMXBean</tt> objects.
*
*/
public static List<GarbageCollectorMXBean> getGarbageCollectorMXBeans() {
return ManagementFactoryHelper.getGarbageCollectorMXBeans();
}
/**
* Returns a list of {@link MemoryPoolMXBean} 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.
*
* @return a list of <tt>MemoryPoolMXBean</tt> objects.
*
*/
public static List<MemoryPoolMXBean> getMemoryPoolMXBeans() {
return ManagementFactoryHelper.getMemoryPoolMXBeans();
}
operatingSystemMXBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
memoryMXBean = ManagementFactory.getMemoryMXBean();
threadMXBean = ManagementFactory.getThreadMXBean();
garbageCollectorMXBeanList = ManagementFactory.getGarbageCollectorMXBeans();
memoryPoolMXBeanList = ManagementFactory.getMemoryPoolMXBeans();
- javan之ManagementFactory
- ManagementFactory api
- javan面向对象编程的概念
- java.lang.management.ManagementFactory学习
- JDK1.7中引用sun.management.ManagementFactory
- 关于ManagementFactory cannot be resolved的问题!
- java.lang.management.ManagementFactory的JAVA属性
- 引用sun.management.ManagementFactory出错的解决办法
- sun.management.ManagementFactory is not visible
- JDK1.7中引用sun.management.ManagementFactory
- JDK1.7中引用sun.management.ManagementFactory
- ManagementFactory-JAVA获取系统相关的信息
- ManagementFactory is not accessible due to restriction on required lbrary
- The type sun.management.ManagementFactory is not visible
- jdk1.7中引用sun.management.ManagementFactory出错
- java 利用ManagementFactory获取jvm,os的一些信息
- java利用ManagementFactory获取tomcat的一些信息
- java.lang包下ManagementFactory类的使用
- DRA62X提升GPU频率
- 自定义title bar冲突问题
- ThinkPHP+ExtJs开发的GM后台管理系统
- 重签名提示:无法对 jar 进行签名: java.util.zip.ZipException
- 给 木子健康管理室 添加微信公众号 并制作一条 图文消息
- javan之ManagementFactory
- 数据结构排序,冒泡,快速,直接选择,直接插入,希尔
- 初学python----lambda
- 回调函数(转载知乎)
- 第十二周 项目二--摩托车继承自行车和机动车
- GNU Readline 库及编程简介
- 那些不能错过的Xcode插件
- UIView
- 【JSP】关于The JSP specification requires that an attribute name is preceded by whitespace