Interface CommandLifecycle

    • Method Detail

      • start

        void start​(ChannelSession channel,
                   Environment env)
            throws java.io.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:
        java.io.IOException - If failed to start
      • destroy

        void destroy​(ChannelSession channel)
              throws java.lang.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:
        java.lang.Exception - if failed to destroy