org.crsh.shell.concurrent
Class SyncShellResponseContext

java.lang.Object
  extended by org.crsh.shell.concurrent.SyncShellResponseContext
All Implemented Interfaces:
ShellProcessContext

public class SyncShellResponseContext
extends Object
implements ShellProcessContext

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
SyncShellResponseContext()
           
SyncShellResponseContext(ShellProcessContext wrapped)
           
 
Method Summary
 void begin(ShellProcess process)
          This method is invoked before the process work begins.
 void cancel()
           
 void end(ShellResponse response)
          This method is invoked when the process ends.
 ShellResponse getResponse()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncShellResponseContext

public SyncShellResponseContext()

SyncShellResponseContext

public SyncShellResponseContext(ShellProcessContext wrapped)
Method Detail

cancel

public void cancel()

getWidth

public int getWidth()
Description copied from interface: ShellProcessContext
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 ShellProcessContext
Returns:
the term width

begin

public void begin(ShellProcess process)
Description copied from interface: ShellProcessContext
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.

Specified by:
begin in interface ShellProcessContext
Parameters:
process - the process

readLine

public String readLine(String msg,
                       boolean echo)
Description copied from interface: ShellProcessContext
A callback made by the process when it needs to read a line of text on the term.

Specified by:
readLine in interface ShellProcessContext
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

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

getResponse

public ShellResponse getResponse()
                          throws InterruptedException
Throws:
InterruptedException


Copyright © 2011 eXo Platform SAS. All Rights Reserved.