class ClientProcessContext extends Object implements ShellProcessContext
| Modifier and Type | Field and Description |
|---|---|
(package private) ArrayList<Chunk> |
buffer
.
|
(package private) ClientAutomaton |
client
.
|
private boolean |
closed
.
|
(package private) ShellProcess |
process
.
|
| Constructor and Description |
|---|
ClientProcessContext(ClientAutomaton client,
ShellProcess process) |
| Modifier and Type | Method and Description |
|---|---|
void |
end(ShellResponse response)
This method is invoked when the process ends.
|
private void |
ensureSize()
Ensure we have a recent size, the size is considered as recent if it's younger than 2 second, otherwise
send a get size message.
|
(package private) void |
execute() |
void |
flush() |
Class<Chunk> |
getConsumedType() |
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.
|
int |
getWidth()
Returns the screen width in chars.
|
void |
provide(Chunk element) |
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 chunk)
Write a chunk to the screen.
|
final ClientAutomaton client
final ShellProcess process
private boolean closed
ClientProcessContext(ClientAutomaton client, ShellProcess process)
private void ensureSize()
void execute()
public int getWidth()
ScreenContextgetWidth in interface ScreenContextpublic int getHeight()
ScreenContextgetHeight in interface ScreenContextpublic boolean takeAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.takeAlternateBuffer in interface InteractionContextpublic boolean releaseAlternateBuffer()
InteractionContextFlushable.flush() method
is invoked.releaseAlternateBuffer in interface InteractionContextpublic 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 chunk) throws IOException
ScreenContextwrite in interface ScreenContextchunk - the chunkIOException - any io exceptionpublic void provide(Chunk element) throws IOException
IOExceptionpublic Class<Chunk> getConsumedType()
public void end(ShellResponse response)
ShellProcessContextend in interface ShellProcessContextresponse - the shell responseCopyright © 2014 eXo Platform SAS. All Rights Reserved.