@ThreadSafe public class ProcessManager extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ProcessManager.RunningProcess |
Modifier and Type | Field and Description |
---|---|
static java.io.File |
INHERIT_IO_FILE
A symbolic file to indicate that we want to inherit I/O of parent process.
|
Modifier and Type | Method and Description |
---|---|
static ProcessManager |
create() |
ProcessManager.RunningProcess |
startProcess(java.lang.String id,
java.lang.String command,
java.util.List<java.lang.String> args,
java.util.Map<java.lang.String,java.lang.String> env)
Forks a process with the given command, arguments, and additional environment variables.
|
ProcessManager.RunningProcess |
startProcess(java.lang.String id,
java.lang.String command,
java.util.List<java.lang.String> args,
java.util.Map<java.lang.String,java.lang.String> env,
java.io.File outputFile) |
void |
stopProcess(java.lang.String id)
Stops a previously started process identified by its unique id.
|
public static final java.io.File INHERIT_IO_FILE
public static ProcessManager create()
public ProcessManager.RunningProcess startProcess(java.lang.String id, java.lang.String command, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> env) throws java.io.IOException
id
- A unique id for the processcommand
- The name of the executable to runargs
- Arguments to provide to the executableenv
- Additional environment variables for the process to be forkedjava.io.IOException
public ProcessManager.RunningProcess startProcess(java.lang.String id, java.lang.String command, java.util.List<java.lang.String> args, java.util.Map<java.lang.String,java.lang.String> env, java.io.File outputFile) throws java.io.IOException
java.io.IOException
public void stopProcess(java.lang.String id)