Interface CommandLifecycle

All Known Subinterfaces:
AsyncCommand, Command, InvertedShell
All Known Implementing Classes:
AbstractCommandSupport, AbstractFileSystemCommand, InvertedShellWrapper, ProcessShell, UnknownCommand

public interface CommandLifecycle
Author:
Apache MINA SSHD Project
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method is called by the SSH server to destroy the command because the client has disconnected somehow.
    void
    Starts the command execution.
  • Method Details

    • start

      void start(ChannelSession channel, Environment env) throws IOException
      Starts the command execution. 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(); 
       
      Parameters:
      channel - The ChannelSession through which the command has been received
      env - The Environment
      Throws:
      IOException - If failed to start
    • destroy

      void destroy(ChannelSession channel) throws Exception
      This method is called by the SSH server to destroy the command because the client has disconnected somehow.
      Parameters:
      channel - The ChannelSession through which the command has been received
      Throws:
      Exception - if failed to destroy