Interface IRemoteProcess

    • Method Detail

      • destroy

        void destroy()
        Terminate the process
      • exitValue

        int exitValue()
        Returns the exit value for the process
        Returns:
        the exit value
      • getErrorStream

        InputStream getErrorStream()
        Gets the error output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding output or error streams.
        Returns:
        the output stream connected to the standard error of the process
      • getInputStream

        InputStream getInputStream()
        Gets an InputStream which can be used to read the standard output stream of the process Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Returns:
        the input stream connected to the standard output of the process
      • getOutputStream

        OutputStream getOutputStream()
        Gets an output stream which can be used to write to the standard input stream of the process
        Returns:
        the output stream connected to the standard input of the process
      • getService

        <T extends IRemoteProcess.Service> T getService​(Class<T> service)
        Get the service for this remote process that implements the given interface.
        Parameters:
        service - the interface the required service must implements
        Returns:
        the desired service or null if there is no such service available
        Since:
        2.0
      • hasService

        <T extends IRemoteProcess.Service> boolean hasService​(Class<T> service)
        Does this remote process support the given service.
        Parameters:
        service - The service to be tested
        Returns:
        true if this connection supports the service
        Since:
        2.0
      • waitFor

        int waitFor()
             throws InterruptedException
        Wait until the process has terminated Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Returns:
        the exit value of the process
        Throws:
        InterruptedException - if the current thread is interrupted by another thread while it is waiting
      • isCompleted

        boolean isCompleted()
        Check if the remote process has completed. Note: some implementations (e.g. JSch) will not work correctly if the remote process generates stdout or stderr but the calling thread does not read the corresponding input or error streams.
        Returns:
        true if remote process has completed
      • getRemoteConnection

        IRemoteConnection getRemoteConnection()
        Get the connection that is used by this process
        Returns:
        connection used by this process
        Since:
        2.0
      • getProcessBuilder

        IRemoteProcessBuilder getProcessBuilder()
        Get the process builder used to create this process
        Returns:
        process builder used to create this process
        Since:
        2.0