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 TypeMethodDescriptionintexecute(ProcessContext ctx) Synchronously executes the givenProcessContext.intSynchronously executes the given command in the given environment and directory.voidquit()Terminates thisProcessExecutorand 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 usedirectory- the directory to execute the command instdOutput- callback handle to process the processes standard outputstdError- 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
Synchronously executes the givenProcessContext.- 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
Terminates thisProcessExecutorand frees all associated resources. Note the lifecycle of aProcessExecutorhas tenant scope, i.e. there is no need to callquit()except when shutting down the server (what will be done automatically).- Throws:
IOException- on any error
-