org.crsh.shell.impl.command
Class CRaSHProcess

java.lang.Object
  extended by org.crsh.shell.impl.command.CRaSHProcess
All Implemented Interfaces:
ShellProcess
Direct Known Subclasses:
CRaSHCommandProcess, CRaSHResponseProcess

abstract class CRaSHProcess
extends Object
implements ShellProcess


Field Summary
private  boolean cancelled
          .
protected  CRaSHSession crash
          .
protected  String request
          .
private  Thread thread
          .
 
Constructor Summary
protected CRaSHProcess(CRaSHSession crash, String request)
           
 
Method Summary
 void cancel()
          Signals the process it should be cancelled.
(package private) abstract  ShellResponse doInvoke(ShellProcessContext context)
           
 void execute(ShellProcessContext processContext)
          Begin the process.
 KeyHandler getKeyHandler()
          Returns the key handler or null if the process won't handle key events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

crash

protected final CRaSHSession crash
.


request

protected final String request
.


thread

private volatile Thread thread
.


cancelled

private volatile boolean cancelled
.

Constructor Detail

CRaSHProcess

protected CRaSHProcess(CRaSHSession crash,
                       String request)
Method Detail

execute

public void execute(ShellProcessContext processContext)
Description copied from interface: ShellProcess
Begin the process. The client of this method should make no assumption whether the process is executed in a synchronous or asynchronous manner. The process will be termined when the process signals it with an invocation of the ShellProcessContext.end(ShellResponse) method.

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

getKeyHandler

public KeyHandler getKeyHandler()
Description copied from interface: ShellProcess
Returns the key handler or null if the process won't handle key events.

Specified by:
getKeyHandler in interface ShellProcess
Returns:
the key handler for this process

doInvoke

abstract ShellResponse doInvoke(ShellProcessContext context)
                         throws InterruptedException
Throws:
InterruptedException

cancel

public void cancel()
Description copied from interface: ShellProcess
Signals the process it should be cancelled. This method cannot be be called before the process has started, it can be called multiple times after the process has started. The cancellation of the process is asynchronous, the cancellation of the process will terminate the current context lifecycle by calling the ShellProcessContext.end(ShellResponse) method.

Specified by:
cancel in interface ShellProcess


Copyright © 2015 eXo Platform SAS. All Rights Reserved.