本文整理汇总了Java中java.lang.management.ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE属性的典型用法代码示例。如果您正苦于以下问题:Java ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE属性的具体用法?Java ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE怎么用?Java ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.lang.management.ManagementFactory
的用法示例。
在下文中一共展示了ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doMemoryManagerMXBeanTest
private final int doMemoryManagerMXBeanTest(MBeanServerConnection mbsc) {
int errorCount = 0 ;
System.out.println("---- MemoryManagerMXBean") ;
try {
ObjectName filterName =
new ObjectName(ManagementFactory.MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE
+ ",*");
Set<ObjectName> onSet = mbsc.queryNames(filterName, null);
for (Iterator<ObjectName> iter = onSet.iterator(); iter.hasNext(); ) {
ObjectName memoryManagerName = iter.next() ;
System.out.println("-------- " + memoryManagerName) ;
MBeanInfo mbInfo = mbsc.getMBeanInfo(memoryManagerName);
System.out.println("getMBeanInfo\t\t" + mbInfo);
errorCount += checkNonEmpty(mbInfo);
MemoryManagerMXBean memoryManager = null;
memoryManager =
JMX.newMXBeanProxy(mbsc,
memoryManagerName,
MemoryManagerMXBean.class) ;
System.out.println("getMemoryPoolNames\t\t"
+ Arrays.deepToString(memoryManager.getMemoryPoolNames()));
System.out.println("getName\t\t"
+ memoryManager.getName());
System.out.println("isValid\t\t"
+ memoryManager.isValid());
}
System.out.println("---- OK\n") ;
} catch (Exception e) {
Utils.printThrowable(e, true) ;
errorCount++ ;
System.out.println("---- ERROR\n") ;
}
return errorCount ;
}