public class ProcessManager extends Object
Constructor and Description |
---|
ProcessManager()
Construct a ProcessManager object and start the gobbler threads.
|
Modifier and Type | Method and Description |
---|---|
void |
destroyProcess()
If a process is currently running then this method destroys it so
that the ProcessManager instance can be used to start another
process
|
boolean |
isProcessRunning() |
int |
runProcess(String[] argv,
boolean dumpOutput)
Run the given external process.
|
int |
runProcess(String[] argv,
File dir,
OutputStream out,
OutputStream err)
Run the given external process.
|
int |
runProcess(String[] argv,
OutputStream out,
OutputStream err) |
OutputStream |
startProcess(String[] argv,
File dir,
OutputStream out,
OutputStream err)
Sometimes you want to start an external process and pass data to it
at different intervals.
|
public ProcessManager()
public boolean isProcessRunning()
public void destroyProcess() throws IOException
IOException
public OutputStream startProcess(String[] argv, File dir, OutputStream out, OutputStream err) throws IOException
IOException
public int runProcess(String[] argv, boolean dumpOutput) throws IOException
argv
- the process command line, suitable for passing to
Runtime.exec
.dumpOutput
- should we copy the process output and error streams to
the Java output and error streams or just consume them silently?IOException
public int runProcess(String[] argv, OutputStream out, OutputStream err) throws IOException
IOException
public int runProcess(String[] argv, File dir, OutputStream out, OutputStream err) throws IOException
argv
- the process command line, suitable for passing to
Runtime.exec
.IOException
Copyright © 2024 GATE. All rights reserved.