org.apache.sshd.server.shell
Class InvertedShellWrapper

java.lang.Object
  extended by org.apache.sshd.server.shell.InvertedShellWrapper
All Implemented Interfaces:
Command

public class InvertedShellWrapper
extends Object
implements Command

A shell implementation that wraps an instance of InvertedShell as a ShellFactory.Shell. This is useful when using external processes. When starting the shell, this wrapper will also create a thread used to pump the streams and also to check if the shell is alive.

Author:
Apache MINA SSHD Project

Constructor Summary
InvertedShellWrapper(InvertedShell shell)
           
 
Method Summary
 void destroy()
          Destroy the shell.
protected  void pumpStreams()
           
 void setErrorStream(OutputStream err)
          Set the error stream that can be used by the shell to write its errors.
 void setExitCallback(ExitCallback callback)
          Set the callback that the shell has to call when it is closed.
 void setInputStream(InputStream in)
          Set the input stream that can be used by the shell to read input.
 void setOutputStream(OutputStream out)
          Set the output stream that can be used by the shell to write its output.
 void start(Environment env)
          Starts the shell.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvertedShellWrapper

public InvertedShellWrapper(InvertedShell shell)
Method Detail

setInputStream

public void setInputStream(InputStream in)
Description copied from interface: Command
Set the input stream that can be used by the shell to read input.

Specified by:
setInputStream in interface Command

setOutputStream

public void setOutputStream(OutputStream out)
Description copied from interface: Command
Set the output stream that can be used by the shell to write its output.

Specified by:
setOutputStream in interface Command

setErrorStream

public void setErrorStream(OutputStream err)
Description copied from interface: Command
Set the error stream that can be used by the shell to write its errors.

Specified by:
setErrorStream in interface Command

setExitCallback

public void setExitCallback(ExitCallback callback)
Description copied from interface: Command
Set the callback that the shell has to call when it is closed.

Specified by:
setExitCallback in interface Command

start

public void start(Environment env)
           throws IOException
Description copied from interface: Command
Starts the shell. All streams must have been set before calling this method. The command should implement Runnable, and this method should spawn a new thread like:
 Thread(this).start();
 
 

Specified by:
start in interface Command
Throws:
IOException

destroy

public void destroy()
Description copied from interface: Command
Destroy the shell. This method can be called by the SSH server to destroy the shell because the client has disconnected somehow.

Specified by:
destroy in interface Command

pumpStreams

protected void pumpStreams()


Copyright © 2008-2012 Apache Software Foundation. All Rights Reserved.