/* * shutdown.java * * Implementation of the SHUTDOWN command. */ package commands; import kernel.*; /** * Terminates the system by terminating the root process. * * @author Jan Horky */ public class shutdown extends AbstractProcess { /** * Realizes the SHUTDOWN command. * * @throws AppException * Exception caused by an error in the virtual machines manager. */ public void realization() throws AppException { AbstractProcess rootProcess = getServices().getProcess(1); if (rootProcess != null) rootProcess.kill(); else this.printError("shutdown: Can't find the root process\n"); } /** * Provides full description of the command to be used in the MAN command. * * @return Full description of the command including the syntax. */ public String getHelp() { return "\n\nDescription:\nTerminates the system.\n\nUsage:\n" + "This command doesn't have any arguments ..."; } }