|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.shell.impl.remoting.ClientProcessContext
class ClientProcessContext
Field Summary | |
---|---|
(package private) ArrayList<Chunk> |
buffer
. |
(package private) ClientAutomaton |
client
. |
private boolean |
closed
. |
(package private) ShellProcess |
process
. |
Constructor Summary | |
---|---|
ClientProcessContext(ClientAutomaton client,
ShellProcess process)
|
Method Summary | |
---|---|
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()
Returns the class of the element generic type. |
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)
Provide an element. |
String |
readLine(String msg,
boolean echo)
Display a message and read a line on the console. |
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer. |
boolean |
takeAlternateBuffer()
Take control of the alternate buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final ClientAutomaton client
final ShellProcess process
final ArrayList<Chunk> buffer
private boolean closed
Constructor Detail |
---|
ClientProcessContext(ClientAutomaton client, ShellProcess process)
Method Detail |
---|
private void ensureSize()
void execute()
public int getWidth()
ScreenContext
getWidth
in interface ScreenContext<Chunk>
public int getHeight()
ScreenContext
getHeight
in interface ScreenContext<Chunk>
public boolean takeAlternateBuffer()
InteractionContext
Flushable.flush()
method
is invoked.
takeAlternateBuffer
in interface InteractionContext<Chunk>
public boolean releaseAlternateBuffer()
InteractionContext
Flushable.flush()
method
is invoked.
releaseAlternateBuffer
in interface InteractionContext<Chunk>
public String getProperty(String name)
InteractionContext
getProperty
in interface InteractionContext<Chunk>
name
- the property name
public String readLine(String msg, boolean echo)
InteractionContext
readLine
in interface InteractionContext<Chunk>
msg
- the message to display before reading a lineecho
- wether or not the line read should be echoed when typing
public void provide(Chunk element) throws IOException
Consumer
provide
in interface Consumer<Chunk>
element
- the provided element
IOException
public Class<Chunk> getConsumedType()
Consumer
getConsumedType
in interface Consumer<Chunk>
public void flush()
flush
in interface Flushable
public void end(ShellResponse response)
ShellProcessContext
end
in interface ShellProcessContext
response
- the shell response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |