|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.nmu.os.shell.Shell | +--edu.nmu.os.shell.ShellImpl
A command shell for the Java Virtual Machine
TODO: man page
Field Summary | |
static java.lang.String |
CLASSPATH_PATH_PROPERTY
|
static java.lang.String |
CLASSPATH_PWD_PROPERTY
|
static java.lang.String |
DEFAULT_CLASSPATH_PATH
|
static java.lang.String |
PATH_PROPERTY
|
static java.lang.String |
PWD_PROPERTY
|
static java.lang.String |
SHELL_LEVEL_PROPERTY
|
static java.lang.String |
USER_PROPERTY
|
Fields inherited from class edu.nmu.os.shell.Shell |
DEFAULT_PROMPT, DEFAULT_SHELL_FACTORY, GET_ERR_PERMISSION, GET_IN_PERMISSION, GET_OUT_PERMISSION, GET_PARENT_SHELL_PERMISSION, SET_SECURITY_MANAGER_PERMISSION |
Constructor Summary | |
protected |
ShellImpl(Shell s,
java.io.InputStream in,
java.io.PrintStream e,
java.io.PrintStream t,
boolean help,
java.lang.String msg)
|
Method Summary | |
protected void |
doHelp()
Used as an alternate run mode for the Shell |
protected void |
exitMessage(java.lang.String s)
Handles an exit message to be given just before the Shell exits |
protected CommandLine |
getCommandLine()
Gets the next CommandLine to be executed |
protected java.io.PrintStream |
getErr0()
Returns the error PrintStream of this Shell |
protected java.io.InputStream |
getIn0()
Returns the InputStream of this Shell |
protected java.util.Properties |
getInitialEnv()
Returns the initial values of environment variable as they should be set if this Shell has no parent |
protected java.io.PrintStream |
getOut0()
Returns the output PrintStream of this Shell |
java.lang.String |
getPrompt()
The user prompt |
void |
handleThrowable(java.lang.Throwable t)
Handles the given Throwable |
protected void |
handleUnresolved(java.lang.String[] unresolved)
Handles a list of unresolved programs |
boolean |
isUser()
Returns whether or not the user is typing commands into this Shell |
protected boolean |
shouldDoHelp()
Returns true if the Shell should run the doHelp() instead of running normally |
Methods inherited from class edu.nmu.os.shell.Shell |
executeCommand, executeCommandLine, getEnv, getEnv, getEnv, getEnv0, getEnv0, getEnv0, getErr, getIn, getOut, getParentShell, getSecurityManager, getShell, getShellLevel, isRunning, main, run, runShell, setEnv, setEnv, setEnv0, setEnv0, setSecurityManager, setSecurityManager0 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SHELL_LEVEL_PROPERTY
public static final java.lang.String USER_PROPERTY
public static final java.lang.String PWD_PROPERTY
public static final java.lang.String PATH_PROPERTY
public static final java.lang.String CLASSPATH_PWD_PROPERTY
public static final java.lang.String CLASSPATH_PATH_PROPERTY
public static final java.lang.String DEFAULT_CLASSPATH_PATH
Constructor Detail |
protected ShellImpl(Shell s, java.io.InputStream in, java.io.PrintStream e, java.io.PrintStream t, boolean help, java.lang.String msg)
Method Detail |
protected boolean shouldDoHelp()
Shell
Shell.doHelp()
instead of running normally
This method is used by Shell.main(String[])
shouldDoHelp
in class Shell
Shell.doHelp()
, false if it should run normallyprotected void doHelp()
Shell
It is expected that this method would print some sort of help screen to the user, though that is not the required behavior.
doHelp
in class Shell
Shell.shouldDoHelp()
public void handleThrowable(java.lang.Throwable t)
Shell
This method handles the given Throwable in an implementation specific manner.
handleThrowable
in class Shell
t
- the Throwableprotected void handleUnresolved(java.lang.String[] unresolved)
Shell
This method is called when the Shell is running and the CommandLine produces unresolved programs
handleUnresolved
in class Shell
unresolved
- the unresolved program namesprotected void exitMessage(java.lang.String s)
Shell
This method is only called during abnormal exit.
exitMessage
in class Shell
s
- the exit message to be handledprotected java.util.Properties getInitialEnv()
Shell
This method is called by the Shell.Shell(Shell)
constructor to set the default environment variables
of the Shell if its parent is null
getInitialEnv
in class Shell
protected CommandLine getCommandLine() throws ShellException
Shell
This method should never return null. If there are no CommandLines available, this method should either hang while it waits or throw a ShellException.
getCommandLine
in class Shell
ShellException
- if an error occursprotected java.io.PrintStream getOut0()
Shell
getOut0
in class Shell
protected java.io.PrintStream getErr0()
Shell
getErr0
in class Shell
protected java.io.InputStream getIn0()
Shell
getIn0
in class Shell
public java.lang.String getPrompt()
Shell
The default implemention returns Shell.DEFAULT_PROMPT
.
getPrompt
in class Shell
public boolean isUser()
Shell
isUser
in class Shell
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |