org.crsh.shell.concurrent
Class AsyncShell.Process

java.lang.Object
  extended by org.crsh.shell.concurrent.AsyncShell.Process
All Implemented Interfaces:
Runnable, ShellProcess, ShellProcessContext
Enclosing class:
AsyncShell

private class AsyncShell.Process
extends Object
implements ShellProcessContext, Runnable, ShellProcess


Field Summary
private  ShellProcess callee
          .
private  ShellProcessContext caller
          .
private  String request
          .
 
Constructor Summary
private AsyncShell.Process(String request)
           
 
Method Summary
 void cancel()
          Attempt to cancel the shell process.
 void end(ShellResponse response)
          This method is invoked when the process ends.
 void execute(ShellProcessContext processContext)
          Begin the process.
 String getProperty(String name)
          Returns the property defined within this context.
 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.
 void run()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

request

private final String request
.


caller

private ShellProcessContext caller
.


callee

private ShellProcess callee
.

Constructor Detail

AsyncShell.Process

private AsyncShell.Process(String request)
Method Detail

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

getProperty

public String getProperty(String name)
Description copied from interface: ShellProcessContext
Returns the property defined within this context.

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

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

execute

public void execute(ShellProcessContext processContext)
Description copied from interface: ShellProcess
Begin the process.

Specified by:
execute in interface ShellProcess
Parameters:
processContext - the process context

cancel

public void cancel()
Description copied from interface: ShellProcess
Attempt to cancel the shell process.

Specified by:
cancel in interface ShellProcess

run

public void run()
Specified by:
run in interface Runnable


Copyright © 2012 eXo Platform SAS. All Rights Reserved.