public class SSHInlineShellProcessContext extends Object implements ShellProcessContext
| Modifier and Type | Field and Description |
|---|---|
private SSHContext |
context
.
|
private PrintStream |
err
.
|
private CountDownLatch |
latch
.
|
private static String |
MSG
.
|
private boolean |
msgDone
.
|
private PrintStream |
out
.
|
private ShellProcess |
process
.
|
private ShellResponse |
response
.
|
| Constructor and Description |
|---|
SSHInlineShellProcessContext(SSHContext context,
ShellProcess process,
PrintStream out,
PrintStream err) |
| Modifier and Type | Method and Description |
|---|---|
void |
end(ShellResponse response)
This method is invoked when the process ends.
|
SSHInlineShellProcessContext |
execute() |
void |
flush() |
int |
getHeight()
Returns the screen height in chars.
|
String |
getProperty(String name)
Returns a generic property, usually this property is resolved by the
shell client.
|
(package private) ShellResponse |
getResponse() |
int |
getWidth()
Returns the screen width in chars.
|
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console, this method call can be blocking until the user provides
a value.
|
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer.
|
boolean |
takeAlternateBuffer()
Take control of the alternate buffer.
|
void |
write(Chunk element)
Write a chunk to the screen.
|
private static final String MSG
private boolean msgDone
private ShellResponse response
private final CountDownLatch latch
private final SSHContext context
private final ShellProcess process
private final PrintStream out
private final PrintStream err
SSHInlineShellProcessContext(SSHContext context, ShellProcess process, PrintStream out, PrintStream err)
public SSHInlineShellProcessContext execute()
public boolean takeAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.takeAlternateBuffer in interface InteractionContextpublic boolean releaseAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.releaseAlternateBuffer in interface InteractionContextpublic int getWidth()
ScreenContextgetWidth in interface ScreenContextpublic int getHeight()
ScreenContextgetHeight in interface ScreenContextpublic String getProperty(String name)
InteractionContextgetProperty in interface InteractionContextname - the property namepublic String readLine(String msg, boolean echo)
InteractionContextreadLine in interface InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typingpublic void write(Chunk element) throws IOException
ScreenContextwrite in interface ScreenContextelement - the chunkIOException - any io exceptionpublic void flush() throws IOException
flush in interface FlushableIOExceptionpublic void end(ShellResponse response)
ShellProcessContextend in interface ShellProcessContextresponse - the shell responseShellResponse getResponse()
Copyright © 2014 eXo Platform SAS. All Rights Reserved.