Interface ProcessExecutor

All Known Implementing Classes:
AbstractProcessExecutor, BasicProcessExecutor, EmbeddedProcessExecutor, LimitedProcessExecutor, ProcessExecutorClient

public interface ProcessExecutor
Service to efficiently execute operation system level processes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Synchronously executes the given ProcessContext.
    int
    execute(String[] command, String[] environment, File directory, Drain stdOutput, Drain stdError)
    Synchronously executes the given command in the given environment and directory.
    void
    Terminates this ProcessExecutor and frees all associated resources.
  • Method Details

    • execute

      int execute(String[] command, String[] environment, File directory, Drain stdOutput, Drain stdError) throws 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:
      IOException - on any error executing the process.
      See Also:
    • execute

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

      void quit() throws 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:
      IOException - on any error