📄 haltcommand.java
字号:
/*
* $Id: HaltCommand.java,v 1.1 2003/11/25 11:52:58 epr Exp $
*/
package org.jnode.shell.command;
import java.io.InputStream;
import java.io.PrintStream;
import javax.naming.NameNotFoundException;
import org.jnode.naming.InitialNaming;
import org.jnode.plugin.PluginManager;
import org.jnode.shell.CommandLine;
import org.jnode.shell.help.*;
/**
* Halts the system
* @author epr
*/
public class HaltCommand {
public static Help.Info HELP_INFO = new Help.Info(
"halt",
"Stop all services and devices, so the computer can be turned off"
);
public static void main(String[] args)
throws Exception {
new HaltCommand().execute(new CommandLine(args), System.in, System.out, System.err);
}
/**
* Execute this command
*/
public void execute(
CommandLine cmdLine,
InputStream in,
PrintStream out,
PrintStream err) {
try {
final PluginManager sm = (PluginManager)InitialNaming.lookup(PluginManager.NAME);
sm.stopPlugins();
} catch (NameNotFoundException ex) {
err.println("Cannot find ServiceManager");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -