public class ProcessControl extends Object
| Constructor and Description |
|---|
ProcessControl(SupportConfig runtime,
Process process) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addShutdownHook(Runnable runnable) |
static boolean |
executeCommandLine(SupportConfig support,
List<String> commandLine,
Consumer<ProcessControl> beforeStop,
StreamProcessor output,
boolean redirectErrorStream) |
static ProcessControl |
fromCommandLine(SupportConfig runtime,
List<String> commandLine,
boolean redirectErrorStream) |
InputStreamReader |
getError() |
Long |
getPid() |
Reader |
getReader() |
boolean |
isAlive() |
static ProcessBuilder |
newProcessBuilder(List<String> commandLine,
boolean redirectErrorStream) |
static ProcessBuilder |
newProcessBuilder(List<String> commandLine,
Map<String,String> environment,
boolean redirectErrorStream) |
static ProcessControl |
start(SupportConfig runtime,
ProcessBuilder processBuilder) |
int |
stop() |
int |
stop(long maxStopTimeoutMillis) |
int |
waitFor() |
int |
waitFor(long timeoutInMs) |
public ProcessControl(SupportConfig runtime, Process process)
public Reader getReader()
public InputStreamReader getError()
public int stop()
public int stop(long maxStopTimeoutMillis)
public boolean isAlive()
public static ProcessControl fromCommandLine(SupportConfig runtime, List<String> commandLine, boolean redirectErrorStream) throws IOException
IOExceptionpublic static ProcessControl start(SupportConfig runtime, ProcessBuilder processBuilder) throws IOException
IOExceptionpublic static ProcessBuilder newProcessBuilder(List<String> commandLine, boolean redirectErrorStream)
public static ProcessBuilder newProcessBuilder(List<String> commandLine, Map<String,String> environment, boolean redirectErrorStream)
public static boolean executeCommandLine(SupportConfig support, List<String> commandLine, Consumer<ProcessControl> beforeStop, StreamProcessor output, boolean redirectErrorStream)
public int waitFor()
throws InterruptedException
InterruptedExceptionpublic int waitFor(long timeoutInMs)
throws InterruptedException
InterruptedExceptionpublic static void addShutdownHook(Runnable runnable)
public Long getPid()
Copyright © 2025. All rights reserved.