Interface ProcessExecutor

    • Method Detail

      • execute

        int execute​(java.lang.String[] command,
                    java.lang.String[] environment,
                    java.io.File directory,
                    Drain stdOutput,
                    Drain stdError)
             throws java.io.IOException
        Synchronously executes the given command in the given environment and directory.
        Parameters:
        command - the command line to execute/
        environment - the environment to use
        directory - the directory to execute the command in
        stdOutput - callback handle to process the processes standard output
        stdError - callback handle to process the processes standard error output
        Returns:
        the exit code of the process
        Throws:
        java.io.IOException - on any error executing the process.
        See Also:
        Runtime.exec(String[], String[], File)
      • execute

        int execute​(ProcessContext ctx)
             throws java.io.IOException
        Synchronously executes the given ProcessContext.
        Parameters:
        ctx - the context to execute
        Returns:
        the exit code of the underlying os process.
        Throws:
        java.io.IOException - on eny error while executing the process.
      • quit

        void quit()
           throws java.io.IOException
        Terminates this ProcessExecutor and frees all associated resources. Note the lifecycle of a ProcessExecutor has tenant scope, i.e. there is no need to call quit() except when shutting down the server (what will be done automatically).
        Throws:
        java.io.IOException - on any error