org.crsh.shell.impl.remoting
Class ServerAutomaton

java.lang.Object
  extended by org.crsh.shell.impl.remoting.ServerAutomaton
All Implemented Interfaces:
Closeable, Shell

public class ServerAutomaton
extends Object
implements Shell


Field Summary
(package private)  ObjectInputStream in
          .
(package private)  CloseableList listeners
          .
(package private)  Logger log
          .
(package private)  ObjectOutputStream out
          .
(package private)  ServerProcess process
          .
 
Constructor Summary
ServerAutomaton(InputStream in, OutputStream out)
           
ServerAutomaton(ObjectOutputStream out, ObjectInputStream in)
           
 
Method Summary
 ServerAutomaton addCloseListener(Closeable closeable)
           
(package private)  void cancel(ServerProcess process)
           
 void close()
           
 CompletionMatch complete(String prefix)
          Completion.
 ShellProcess createProcess(String request)
          Process a request.
(package private)  void execute(ServerProcess process, ShellProcessContext processContext)
           
 String getPrompt()
          Returns the shell prompt.
 String getWelcome()
          Returns the welcome message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

final Logger log
.


in

final ObjectInputStream in
.


out

final ObjectOutputStream out
.


process

ServerProcess process
.


listeners

final CloseableList listeners
.

Constructor Detail

ServerAutomaton

public ServerAutomaton(ObjectOutputStream out,
                       ObjectInputStream in)

ServerAutomaton

public ServerAutomaton(InputStream in,
                       OutputStream out)
                throws IOException
Throws:
IOException
Method Detail

addCloseListener

public ServerAutomaton addCloseListener(Closeable closeable)

getWelcome

public String getWelcome()
Description copied from interface: Shell
Returns the welcome message.

Specified by:
getWelcome in interface Shell
Returns:
the welcome message

getPrompt

public String getPrompt()
Description copied from interface: Shell
Returns the shell prompt.

Specified by:
getPrompt in interface Shell
Returns:
the shell prompt

createProcess

public ShellProcess createProcess(String request)
                           throws IllegalStateException
Description copied from interface: Shell
Process a request.

Specified by:
createProcess in interface Shell
Parameters:
request - the request to process
Returns:
the process
Throws:
IllegalStateException - if the shell cannot create a process

complete

public CompletionMatch complete(String prefix)
Description copied from interface: Shell
Completion.

Specified by:
complete in interface Shell
Parameters:
prefix - the prefix to complete
Returns:
the sorted list of available suffixes

close

public void close()
Specified by:
close in interface Closeable

execute

void execute(ServerProcess process,
             ShellProcessContext processContext)
       throws IllegalStateException
Throws:
IllegalStateException

cancel

void cancel(ServerProcess process)
      throws IllegalStateException
Throws:
IllegalStateException


Copyright © 2014 eXo Platform SAS. All Rights Reserved.