public class ProcessUtils
extends java.lang.Object
| Constructor and Description |
|---|
ProcessUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.concurrent.CompletableFuture<java.lang.Process> |
onExit(java.lang.Process process)
This method is backported from Java 9 for use with Java 8 based tools.
|
public static java.util.concurrent.CompletableFuture<java.lang.Process> onExit(java.lang.Process process)
The following documentation is copied from the Java 9 implementation.
Returns a CompletableFuture<Process> for the termination of the Process.
The CompletableFuture provides the ability
to trigger dependent functions or actions that may be run synchronously
or asynchronously upon process termination.
When the process has terminated the CompletableFuture is
completed regardless
of the exit status of the process.
Calling onExit().get() waits for the process to terminate and returns
the Process. The future can be used to check if the process is
done or to
wait for it to terminate.
Cancelling
the CompletableFuture does not affect the Process.
Processes returned from ProcessBuilder.start() override the
default implementation to provide an efficient mechanism to wait
for process exit.
CompletableFuture<Process> for the Process