|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.crsh.console.Plugin
org.crsh.console.ProcessHandler
class ProcessHandler
A process execution state machine.
| Nested Class Summary | |
|---|---|
(package private) class |
ProcessHandler.Reader
A thread reading a line. |
| Field Summary | |
|---|---|
(package private) Console |
console
. |
(package private) AtomicReference<ProcessHandler.Reader> |
editor
Weather or not a thread is reading a line callback. |
(package private) ShellProcess |
process
. |
| Constructor Summary | |
|---|---|
ProcessHandler(Console console,
ShellProcess process)
|
|
| Method Summary | |
|---|---|
void |
end(ShellResponse response)
This method is invoked when the process ends. |
void |
flush()
|
int |
getHeight()
Returns the screen height in chars. |
String |
getProperty(String propertyName)
Returns a generic property, usually this property is resolved by the shell client. |
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 chunk)
Write a chunk to the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
final Console console
final ShellProcess process
final AtomicReference<ProcessHandler.Reader> editor
| Constructor Detail |
|---|
ProcessHandler(Console console,
ShellProcess process)
| Method Detail |
|---|
public boolean takeAlternateBuffer()
throws IOException
InteractionContextFlushable.flush() method
is invoked.
takeAlternateBuffer in interface InteractionContextIOException
public boolean releaseAlternateBuffer()
throws IOException
InteractionContextFlushable.flush() method
is invoked.
releaseAlternateBuffer in interface InteractionContextIOExceptionpublic String getProperty(String propertyName)
InteractionContext
getProperty in interface InteractionContextpropertyName - the property name
public String readLine(String msg,
boolean echo)
throws IOException,
InterruptedException
InteractionContext
readLine in interface InteractionContextmsg - the message to display before reading a lineecho - wether or not the line read should be echoed when typing
IOException - any io exception
InterruptedException - the thread was interrupted while waiting for the user valuepublic int getWidth()
ScreenContext
getWidth in interface ScreenContextpublic int getHeight()
ScreenContext
getHeight in interface ScreenContext
public void write(Chunk chunk)
throws IOException
ScreenContext
write in interface ScreenContextchunk - the chunk
IOException - any io exception
public void flush()
throws IOException
flush in interface FlushableIOExceptionpublic void end(ShellResponse response)
ShellProcessContext
end in interface ShellProcessContextresponse - the shell response
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||