return null;
}
}
public void output(String[] args) throws SigarException {
Service service = null;
String name = args[0];
String cmd = null;
if (args.length == 2) {
cmd = args[1];
}
try {
service = new Service(name);
if ((cmd == null) || cmd.equals("state")) {
service.list(this.out);
}
else if (cmd.equals("start")) {
service.start();
}
else if (cmd.equals("stop")) {
service.stop();
}
else if (cmd.equals("pause")) {
service.pause();
}
else if (cmd.equals("resume")) {
service.resume();
}
else if (cmd.equals("delete")) {
service.delete();
}
else if (cmd.equals("restart")) {
service.stop(0);
service.start();
}
else {
println("Unsupported service command: " + args[1]);
println("Valid commands: " + COMMANDS);
}
} finally {
if (service != null) {
service.close();
}
}
}