public class AbstractShell extends Object implements SkbShell
SkbShellFactory or a sub-class to create a new object.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,CommandInterpreter> |
commandMap
Mapping of a set of commands to an associated command interpreter.
|
protected int |
exitStatus
The shell's exit status.
|
protected List<String> |
history
Command history of the shell, that is the last n commands.
|
protected String |
id
The shell's identifier.
|
protected boolean |
isRunning
Flag indicating if the shell is running.
|
protected MessageMgr |
mm
The shell's message manager.
|
protected Object |
notify
An object for notifications.
|
protected Thread |
thread
A thread for the shell.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractShell()
Returns a new shell with the default identifier and the default STG and console activated.
|
protected |
AbstractShell(MessageRenderer renderer)
Returns a new shell with the default identifier and the given STG and console activated.
|
protected |
AbstractShell(MessageRenderer renderer,
boolean useConsole)
Returns a new shell with given STG and console flag.
|
protected |
AbstractShell(String id)
Returns a new shell with a given identifier, standard STGroup and console activated.
|
protected |
AbstractShell(String id,
boolean useConsole)
Returns a new shell with given identifier and console flag with standard STGroup.
|
protected |
AbstractShell(String id,
MessageRenderer renderer)
Returns a new shell with a given identifier and STGroup plus console activated.
|
protected |
AbstractShell(String id,
MessageRenderer renderer,
boolean useConsole)
Returns a new shell with given identifier and console flag.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getCommandHistory()
Returns the command history of the shell, that is the last n commands (n depends on implementation).
|
Map<String,CommandInterpreter> |
getCommandMap()
Returns the shell's mapping of commands to associated command interpreters.
|
Set<String> |
getCommands()
Returns all commands set for the shell.
|
int |
getExitStatus()
Returns the exit status of the shell.
|
String |
getID()
Returns the identifier of the shell.
|
MessageMgr |
getMessageManager()
Returns the shell's message manager.
|
boolean |
isRunning()
tests if the shell is running.
|
int |
runShell()
Runs the shell.
|
int |
runShell(BufferedReader reader)
Runs the shell with a particular reader.
|
Thread |
start(Object notify)
Starts the shell as a new thread.
|
void |
stop()
Stops the shell thread.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCommandInterpreter, addCommandInterpreter, addCommandInterpreter, getDescription, getDisplayName, getPromptName, parseLine, promptprotected final Map<String,CommandInterpreter> commandMap
protected final MessageMgr mm
protected boolean isRunning
protected int exitStatus
protected Thread thread
protected Object notify
protected String id
protected AbstractShell()
protected AbstractShell(MessageRenderer renderer)
renderer - a renderer for help messagesIllegalArgumentException - if the STG did not validateprotected AbstractShell(MessageRenderer renderer, boolean useConsole)
renderer - a renderer for help messagesuseConsole - flag to use (true) or not to use (false) console, of false then no output will happen (except for errors on runShell() and some help commands)protected AbstractShell(String id)
id - new shell with identifierIllegalArgumentException - if the STG did not validateprotected AbstractShell(String id, boolean useConsole)
id - new shell with identifieruseConsole - flag to use (true) or not to use (false) console, of false then no output will happenprotected AbstractShell(String id, MessageRenderer renderer)
id - new shell with identifierrenderer - a renderer for help messagesIllegalArgumentException - if the STG did not validateprotected AbstractShell(String id, MessageRenderer renderer, boolean useConsole)
id - new shell with identifierrenderer - a renderer for help messagesuseConsole - flag to use (true) or not to use (false) console, of false then no output will happenpublic String getID()
SkbShellpublic Map<String,CommandInterpreter> getCommandMap()
SkbShellgetCommandMap in interface SkbShellpublic Set<String> getCommands()
SkbShellgetCommands in interface SkbShellpublic Thread start(Object notify)
SkbShellpublic void stop()
SkbShellpublic boolean isRunning()
SkbShellpublic int getExitStatus()
SkbShellgetExitStatus in interface SkbShellpublic int runShell(BufferedReader reader)
SkbShellpublic int runShell()
SkbShellpublic MessageMgr getMessageManager()
SkbShellgetMessageManager in interface SkbShellpublic List<String> getCommandHistory()
SkbShellgetCommandHistory in interface SkbShellCopyright © 2010–2017. All rights reserved.