protected void addUndoTaskToStopComponent(final String componentArgument) {
// component argument must be one of --storage, --server, --agent (a valid argument to the Stop command)
addUndoTask(new ControlCommand.UndoTask("Stopping component: " + componentArgument) {
public void performUndoWork() throws Exception {
Stop stopCommand = new Stop();
CommandLineParser parser = new RHQPosixParser(true);
CommandLine cmdLine = parser.parse(stopCommand.getOptions(), new String[] { componentArgument });
stopCommand.exec(cmdLine);
}
});
}