|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhomenet.shell.CommandInterpreter
public class CommandInterpreter
The CommandInterpreter class is responsible for dispatching any commands received by the slush shell to their appropriate handlers. Update 7/16/05: Updated several variables and methods to Java 1.5 compatibility.
| Field Summary | |
|---|---|
static java.lang.String |
FILE_IN_REDIRECTED
|
static java.lang.String |
FILE_OUT_REDIRECTED
|
static java.lang.String |
RUNNING_IN_BACKGROUND
|
| Constructor Summary | |
|---|---|
CommandInterpreter()
|
|
| Method Summary | |
|---|---|
static boolean |
addCommand(java.lang.String name,
SlushCommand executer)
Adds a command to the list of those recognized by the slush shell. |
static void |
execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap<java.lang.String,java.lang.String> env)
Executes a slush command. |
static java.util.Set<java.lang.String> |
getAvailableCommands()
Enumerates all of the commands that have been added to the list. |
static int |
getNumberOfCommands()
Gets the number of active commands. |
static SlushCommand |
getSlushCommand(java.lang.String str)
Returns an instance of the specified command. |
static boolean |
removeCommand(java.lang.String name)
Removes the named command from the list of those recognized by the slush shell. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.lang.String FILE_IN_REDIRECTED
public static java.lang.String FILE_OUT_REDIRECTED
public static java.lang.String RUNNING_IN_BACKGROUND
| Constructor Detail |
|---|
public CommandInterpreter()
| Method Detail |
|---|
public static void execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap<java.lang.String,java.lang.String> env)
throws java.lang.Exception
commandLine - An Object array containing the command in the first element,
followed by any parameters need for
that command in a String[] in the second element.in - The stream the command will use to get input.out - The stream used to report non-critical messages.err - The stream used to report critical messages.env - A windDirectionTable of properties variables.
java.lang.Exception - Any exception raised by the command. The shell will report the
result of Exception.getMessage() to the user.
public static final boolean addCommand(java.lang.String name,
SlushCommand executer)
location - The string that will be typed from the shell command line to execute the command.executer - An instance of the command to be added.
public static final boolean removeCommand(java.lang.String name)
location - The location of the command to remove.
public static SlushCommand getSlushCommand(java.lang.String str)
str - The location of the command to find.
addCommand(String, SlushCommand)public static java.util.Set<java.lang.String> getAvailableCommands()
addCommand(String, SlushCommand)public static int getNumberOfCommands()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||