public final class AeshCommandInvocation extends java.lang.Object implements CommandInvocation
| Modifier and Type | Field and Description |
|---|---|
private AeshConsoleImpl |
aeshConsole |
private ConsoleCallback |
callback |
private ControlOperator |
controlOperator |
private int |
pid |
| Constructor and Description |
|---|
AeshCommandInvocation(AeshConsoleImpl aeshConsole,
ControlOperator controlOperator,
int pid,
ConsoleCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
void |
executeCommand(java.lang.String input)
This will push the input to the input stream where aesh will
parse it and execute it as a normal "user input".
|
AeshContext |
getAeshContext()
Get AeshContext
|
CommandRegistry |
getCommandRegistry() |
ControlOperator |
getControlOperator() |
java.lang.String |
getHelpInfo(java.lang.String commandName) |
CommandOperation |
getInput()
A blocking call that will return user input from the terminal
|
java.lang.String |
getInputLine()
A blocking call that will return user input from the terminal
after the user has pressed enter.
|
int |
getPid()
The process id.
|
Prompt |
getPrompt() |
Shell |
getShell() |
void |
print(java.lang.String msg)
Print a message on console
|
void |
println(java.lang.String msg)
Print a new line with a message on console;
|
void |
putProcessInBackground()
Put the current process in the background
|
void |
putProcessInForeground()
Put the current process in the foreground
|
void |
setPrompt(Prompt prompt)
Specify the prompt
|
void |
stop()
Stop the console and end the session
|
private final AeshConsoleImpl aeshConsole
private final ControlOperator controlOperator
private final ConsoleCallback callback
private final int pid
public AeshCommandInvocation(AeshConsoleImpl aeshConsole, ControlOperator controlOperator, int pid, ConsoleCallback callback)
public ControlOperator getControlOperator()
getControlOperator in interface CommandInvocationpublic CommandRegistry getCommandRegistry()
getCommandRegistry in interface CommandInvocationpublic Shell getShell()
getShell in interface CommandInvocationpublic void setPrompt(Prompt prompt)
CommandInvocationsetPrompt in interface CommandInvocationpublic Prompt getPrompt()
getPrompt in interface CommandInvocationpublic java.lang.String getHelpInfo(java.lang.String commandName)
getHelpInfo in interface CommandInvocationpublic void stop()
CommandInvocationstop in interface CommandInvocationpublic AeshContext getAeshContext()
CommandInvocationgetAeshContext in interface CommandInvocationpublic CommandOperation getInput() throws java.lang.InterruptedException
CommandInvocationgetInput in interface CommandInvocationjava.lang.InterruptedExceptionpublic java.lang.String getInputLine()
throws java.lang.InterruptedException
CommandInvocationgetInputLine in interface CommandInvocationjava.lang.InterruptedExceptionpublic int getPid()
CommandInvocationgetPid in interface CommandInvocationpublic void putProcessInBackground()
CommandInvocationputProcessInBackground in interface CommandInvocationpublic void putProcessInForeground()
CommandInvocationputProcessInForeground in interface CommandInvocationpublic void executeCommand(java.lang.String input)
CommandInvocationexecuteCommand in interface CommandInvocationinput - command inputpublic void print(java.lang.String msg)
CommandInvocationprint in interface CommandInvocationpublic void println(java.lang.String msg)
CommandInvocationprintln in interface CommandInvocation