java.lang.Object
com.aoapps.hodgepodge.util.ShellInterpreter
- All Implemented Interfaces:
Runnable
AOSH
is a Bourne-shell-like command interpreter
to control the AOServ Client
utilities.- Author:
- AO Industries, Inc.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final TerminalWriter
protected final Reader
protected final TerminalWriter
protected String
-
Constructor Summary
ModifierConstructorDescriptionprotected
ShellInterpreter
(Reader in, TerminalWriter out, TerminalWriter err) protected
ShellInterpreter
(Reader in, TerminalWriter out, TerminalWriter err, String... args) protected
ShellInterpreter
(Reader in, Writer out, Writer err) protected
ShellInterpreter
(Reader in, Writer out, Writer err, String[] args) -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Clears the screen.protected abstract String
getName()
final long
getPid()
final long
getPID()
Deprecated.protected abstract String
protected abstract boolean
handleCommand
(String[] args) Processes one command and returns.protected final boolean
isAlive()
protected final boolean
final void
protected abstract ShellInterpreter
newShellInterpreter
(Reader in, TerminalWriter out, TerminalWriter err, String[] args) final void
run()
If arguments were provided, executes that command.
-
Field Details
-
in
-
out
-
err
-
status
-
-
Constructor Details
-
ShellInterpreter
-
ShellInterpreter
-
ShellInterpreter
-
ShellInterpreter
-
-
Method Details
-
clear
Clears the screen.- Throws:
IOException
-
getName
-
getPid
public final long getPid() -
getPID
Deprecated.Please usegetPid()
instead. -
getPrompt
- Throws:
IOException
SQLException
-
handleCommand
Processes one command and returns.- Throws:
IOException
SQLException
-
isAlive
protected final boolean isAlive() -
isInteractive
protected final boolean isInteractive() -
jobs
-
newShellInterpreter
protected abstract ShellInterpreter newShellInterpreter(Reader in, TerminalWriter out, TerminalWriter err, String[] args) -
run
public final void run()If arguments were provided, executes that command. Otherwise, reads fromin
until end of file orexit
.
-
getPid()
instead.