org.crsh.processor.jline
Class JLineProcessContext

java.lang.Object
  extended by org.crsh.processor.jline.JLineProcessContext
All Implemented Interfaces:
Flushable, InteractionContext, IOContext<Chunk>, Pipe<Chunk>, ShellProcessContext

 class JLineProcessContext
extends Object
implements ShellProcessContext


Field Summary
(package private)  CountDownLatch latch
          .
private static Character NO_ECHO
          .
(package private)  JLineProcessor processor
          .
(package private)  AtomicReference<ShellResponse> resp
          .
 
Constructor Summary
JLineProcessContext(JLineProcessor processor)
           
 
Method Summary
 void end(ShellResponse response)
          This method is invoked when the process ends.
 void flush()
           
 int getHeight()
          Returns the term height in chars.
 String getProperty(String name)
          Returns a generic property, usually this property is resolved by the shell client.
 int getWidth()
          Returns the term 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_ECHO

private static final Character NO_ECHO
.


processor

final JLineProcessor processor
.


latch

final CountDownLatch latch
.


resp

final AtomicReference<ShellResponse> resp
.

Constructor Detail

JLineProcessContext

public JLineProcessContext(JLineProcessor processor)
Method Detail

getWidth

public int getWidth()
Description copied from interface: IOContext
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Specified by:
getWidth in interface IOContext<Chunk>
Returns:
the term width

getHeight

public int getHeight()
Description copied from interface: IOContext
Returns the term height in chars. When the value is not positive it means the value could not be determined.

Specified by:
getHeight in interface IOContext<Chunk>
Returns:
the term height

getProperty

public String getProperty(String name)
Description copied from interface: InteractionContext
Returns a generic property, usually this property is resolved by the shell client.

Specified by:
getProperty in interface InteractionContext
Parameters:
name - the property name
Returns:
the property value

readLine

public String readLine(String msg,
                       boolean echo)
Description copied from interface: InteractionContext
Display a message and read a line on the console. If no line can be read then null is returned.

Specified by:
readLine in interface InteractionContext
Parameters:
msg - the message to display before reading a line
echo - wether or not the line read should be echoed when typing
Returns:
the line read

provide

public void provide(Chunk element)
             throws IOException
Description copied from interface: Pipe
Provide an element.

Specified by:
provide in interface Pipe<Chunk>
Parameters:
element - the provided element
Throws:
IOException

flush

public void flush()
Specified by:
flush in interface Flushable

end

public void end(ShellResponse response)
Description copied from interface: ShellProcessContext
This method is invoked when the process ends.

Specified by:
end in interface ShellProcessContext
Parameters:
response - the shell response


Copyright © 2012 eXo Platform SAS. All Rights Reserved.