public interface ProcessExecutor
| Modifier and Type | Method and Description |
|---|---|
int |
execute(ProcessContext ctx)
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 |
quit()
Terminates this
ProcessExecutor and frees all associated resources. |
int execute(String[] command, String[] environment, File directory, Drain stdOutput, Drain stdError) throws IOException
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 outputIOException - on any error executing the process.Runtime.exec(String[], String[], File)int execute(ProcessContext ctx) throws IOException
ProcessContext.ctx - the context to executeIOException - on eny error while executing the process.void quit() throws IOException
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).IOException - on any errorCopyright © 2017 SAP SE. All Rights Reserved.