本文整理汇总了Java中java.lang.management.ManagementFactory.RUNTIME_MXBEAN_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java ManagementFactory.RUNTIME_MXBEAN_NAME属性的具体用法?Java ManagementFactory.RUNTIME_MXBEAN_NAME怎么用?Java ManagementFactory.RUNTIME_MXBEAN_NAME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.lang.management.ManagementFactory
的用法示例。
在下文中一共展示了ManagementFactory.RUNTIME_MXBEAN_NAME属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRuntimeMXBeanTest
private final int doRuntimeMXBeanTest(MBeanServerConnection mbsc) {
int errorCount = 0 ;
System.out.println("---- RuntimeMXBean") ;
try {
ObjectName runtimeName =
new ObjectName(ManagementFactory.RUNTIME_MXBEAN_NAME) ;
MBeanInfo mbInfo = mbsc.getMBeanInfo(runtimeName);
errorCount += checkNonEmpty(mbInfo);
System.out.println("getMBeanInfo\t\t" + mbInfo);
RuntimeMXBean runtime = null;
runtime =
JMX.newMXBeanProxy(mbsc,
runtimeName,
RuntimeMXBean.class) ;
System.out.println("getClassPath\t\t"
+ runtime.getClassPath());
System.out.println("getInputArguments\t\t"
+ runtime.getInputArguments());
System.out.println("getLibraryPath\t\t"
+ runtime.getLibraryPath());
System.out.println("getManagementSpecVersion\t\t"
+ runtime.getManagementSpecVersion());
System.out.println("getName\t\t"
+ runtime.getName());
System.out.println("getSpecName\t\t"
+ runtime.getSpecName());
System.out.println("getSpecVendor\t\t"
+ runtime.getSpecVendor());
System.out.println("getSpecVersion\t\t"
+ runtime.getSpecVersion());
System.out.println("getStartTime\t\t"
+ runtime.getStartTime());
System.out.println("getSystemProperties\t\t"
+ runtime.getSystemProperties());
System.out.println("getUptime\t\t"
+ runtime.getUptime());
System.out.println("getVmName\t\t"
+ runtime.getVmName());
System.out.println("getVmVendor\t\t"
+ runtime.getVmVendor());
System.out.println("getVmVersion\t\t"
+ runtime.getVmVersion());
boolean supported = runtime.isBootClassPathSupported() ;
System.out.println("isBootClassPathSupported\t\t"
+ supported);
if ( supported ) {
System.out.println("getBootClassPath\t\t"
+ runtime.getBootClassPath());
}
System.out.println("---- OK\n") ;
} catch (Exception e) {
Utils.printThrowable(e, true) ;
errorCount++ ;
System.out.println("---- ERROR\n") ;
}
return errorCount ;
}