Interface CommandLifecycle

    • Method Detail

      • 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