/* Failures on the "local" side, the one invoking the command. */ catch (ReflectionException e) {
Throwable cause = e.getCause(); if (cause instanceof NoSuchMethodException) { /* We want JMXExecutor to match the behavior of the other CommandExecutors */
String message = "Unknown diagnostic command: " + operation;
stderr = exceptionTraceAsString(new IllegalArgumentException(message, e));
} else {
rethrowExecutorException(operation, dcmdArgs, e);
}
}
/* Failures on the "local" side, the one invoking the command. */ catch (InstanceNotFoundException | IOException e) {
rethrowExecutorException(operation, dcmdArgs, e);
}
/* Failures on the remote side, the one executing the invoked command. */ catch (MBeanException e) {
stdout = exceptionTraceAsString(e);
}
/** *ConvertfromdiagnosticcommandtoMBeanmethodname * *Examples: *help-->help *VM.version-->vmVersion *VM.command_line-->vmCommandLine
*/ privatestatic String commandToMethodName(String cmd) {
String operation = ""; boolean up = false; /* First letter is to be lower case */
/* *Ifa'.'or'_'isencountereditisnotcopied, *insteadthenextcharacterwillbeconvertedtouppercase
*/ for (char c : cmd.toCharArray()) { if (('.' == c) || ('_' == c)) {
up = true;
} elseif (up) {
operation = operation.concat(Character.toString(c).toUpperCase());
up = false;
} else {
operation = operation.concat(Character.toString(c).toLowerCase());
}
}
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.