ProcessHandle Interface

The ProcessHandle interface lets you identify and control native processes. The Process class is different from ProcessHandle because it lets you control processes started only by the methods ProcessBuilder.start and Runtime.exec; however, the Process class lets you access process input, output, and error streams.

See Filtering Processes with Streams for an example of the ProcessHandle interface. The following table summarizes the methods of this interface:

Table 6-3 ProcessHandle Interface Methods

Method Type Related Methods
Retrieve all operating system processes.
Retrieve process handle.
Retrieve information about the process.
Retrieve stream of direct and indirect child processes.
Destroy process.
Return a CompletableFuture instance that will be completed when the process exits. See Handling Processes When They Terminate with the onExit Method for an example.