SummaryReporterpublic class SummaryReporter extends Object
Fields Summary |
---|
private final MBeanServerConnection | mbsc | private final com.sun.enterprise.util.i18n.StringManager | sm | private static final String | secretProperty |
Methods Summary |
---|
private java.lang.String | getOSInfo(java.lang.management.OperatingSystemMXBean os)
final StringBuilderNewLineAppender sb = new StringBuilderNewLineAppender(new StringBuilder());
sb.append(sm.getString("os.info"));
sb.append(sm.getString("os.name", os.getName()));
sb.append(sm.getString("os.arch", os.getArch(), os.getVersion()));
sb.append(sm.getString("os.nproc", os.getAvailableProcessors()));
return ( sb.toString() );
| private java.lang.String | getProperties(java.lang.management.RuntimeMXBean rt)
final StringBuilderNewLineAppender sb = new StringBuilderNewLineAppender(new StringBuilder());
final Map<String, String> unsorted = rt.getSystemProperties();
// I decided to sort this for better readability -- 27 Feb 2006
final TreeMap<String, String> props = new TreeMap<String, String>(unsorted);
sb.append(sm.getString("rt.sysprops"));
for (final String n : props.keySet()) {
sb.append(n + " = " + props.get(n));
}
return ( sb.toString() );
| public java.lang.String | getSummaryReport()
try {
final StringBuilderNewLineAppender sb = new StringBuilderNewLineAppender(new StringBuilder());
final OperatingSystemMXBean os = ManagementFactory.newPlatformMXBeanProxy(mbsc,
ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME, OperatingSystemMXBean.class);
sb.append(getOSInfo(os));
final RuntimeMXBean rt = ManagementFactory.newPlatformMXBeanProxy(mbsc,
ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
sb.append(getVMInfo(rt));
return ( sb.toString(secretProperty) );
} catch(final Exception e) {
throw new RuntimeException(e);
}
| private java.lang.String | getVMInfo(java.lang.management.RuntimeMXBean rt)
final StringBuilderNewLineAppender sb = new StringBuilderNewLineAppender(new StringBuilder());
sb.append(sm.getString("rt.info", rt.getName()));
sb.append(sm.getString("rt.bcp", rt.getBootClassPath()));
sb.append(sm.getString("rt.cp", rt.getClassPath()));
sb.append(sm.getString("rt.libpath", rt.getLibraryPath()));
sb.append(sm.getString("rt.nvv", rt.getVmName(), rt.getVmVendor(), rt.getVmVersion()));
sb.append(getProperties(rt));
return ( sb.toString() );
|
|