org.crsh.shell
Interface ShellProcessContext

All Known Implementing Classes:
SyncShellResponseContext

public interface ShellProcessContext

The process context is the main interaction interface between a shell process and its context.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 void begin(ShellProcess process)
          This method is invoked before the process work begins.
 void end(ShellResponse response)
          This method is invoked when the process ends.
 int getWidth()
          Returns the term width in chars.
 String readLine(String msg, boolean echo)
          A callback made by the process when it needs to read a line of text on the term.
 

Method Detail

getWidth

int getWidth()
Returns the term width in chars. When the value is not positive it means the value could not be determined.

Returns:
the term width

begin

void begin(ShellProcess process)
This method is invoked before the process work begins. It provides the process callback that can be used during the process execution by the context.

Parameters:
process - the process

readLine

String readLine(String msg,
                boolean echo)
A callback made by the process when it needs to read a line of text on the term.

Parameters:
msg - the message to display prior reading the term
echo - whether the input line should be echoed or not
Returns:
the line read or null if no line was possible to be read

end

void end(ShellResponse response)
This method is invoked when the process ends.

Parameters:
response - the shell response


Copyright © 2011 eXo Platform SAS. All Rights Reserved.