private ArrayList<String> arguments = new ArrayList<String>();
protected Object doExecute() throws Exception {
CommandContext context2 = new CommandContext();
context2.setFormatter(new CommandShellOutputFormatter(System.out));
Command currentCommand = command.getClass().newInstance();
try {
currentCommand.setCommandContext(context2);
// must be added first
if (command instanceof AbstractJmxCommand) {
arguments.add(0, "--jmxlocal");
}
currentCommand.execute(arguments);
return null;
} catch (Throwable e) {
Throwable cur = e;
while (cur.getCause() != null) {
cur = cur.getCause();