// get the set active JVMs on the specified host.
Set<Integer> jvms = monitoredHost.activeVms();
for (Integer jvm: jvms) {
StringBuilder output = new StringBuilder();
Throwable lastError = null;
int lvmid = jvm;
output.append(String.valueOf(lvmid));
if (arguments.isQuiet()) {
System.out.println(output); continue;
}
MonitoredVm vm = null;
String vmidString = "//" + lvmid;
String errorString = null;
try { // Note: The VM associated with the current VM id may // no longer be running so these queries may fail. We // already added the VM id to the output stream above. // If one of the queries fails, then we try to add a // reasonable message to indicate that the requested // info is not available.
errorString = " -- process information unavailable";
VmIdentifier id = new VmIdentifier(vmidString);
vm = monitoredHost.getMonitoredVm(id, 0);
errorString = " -- main class information unavailable";
output.append(' ').append(MonitoredVmUtil.mainClass(vm,
arguments.showLongPaths()));
if (arguments.showMainArgs()) {
errorString = " -- main args information unavailable";
String mainArgs = MonitoredVmUtil.mainArgs(vm); if (mainArgs != null && mainArgs.length() > 0) {
output.append(' ').append(mainArgs);
}
} if (arguments.showVmArgs()) {
errorString = " -- jvm args information unavailable";
String jvmArgs = MonitoredVmUtil.jvmArgs(vm); if (jvmArgs != null && jvmArgs.length() > 0) {
output.append(' ')
.append( // multi-line args are permitted
jvmArgs.replace("\n", "\\n").replace("\r", "\\r")
);
}
} if (arguments.showVmFlags()) {
errorString = " -- jvm flags information unavailable";
String jvmFlags = MonitoredVmUtil.jvmFlags(vm); if (jvmFlags != null && jvmFlags.length() > 0) {
output.append(' ').append(jvmFlags);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.