-
JEP
-
Resolution: Delivered
-
P2
-
Alan Bateman
-
Feature
-
Open
-
SE
-
-
M
-
M
-
102
Summary
Improve the API for controlling and managing operating-system processes.
Motivation
The limitations of the current API often force developers to resort to native code.
Description
Java SE provides limited support for native operating-system processes. It provides a basic API to setup the environment and start a process. The process streams can, since Java SE 7, be redirected to files, pipes, or can be inherited. Once started, the API can be used to destroy the process and/or wait for the process to terminate.
The java.lang.Process class is enhanced to provide the operating specific process id of the process, information about the process including the arguments, the command, the start time of the process, the accumulated cpu time of the process and the user name for the process.
The java.lang.ProcessHandle class returns information about each process as provided by the operating system including process id, arguments, command, start time, etc. A ProcessHandle can return the process' parent, and the direct children, and to all descendants via a stream of ProcessHandles.
ProcessHandles can be used to destroy processes and monitor process liveness. With ProcessHandle.onExit, the asynchronous mechanisms of CompletableFuture can be used to schedule an action to be taken when the process exits.
Access to information about processes and control of processes is subject to security manager permissions and are limited by the normal operating system access controls.
Testing
The classes or methods introduced will require new unit tests that can be developed along with the implementation. More functional tests would be useful too.
Risks and Assumptions
The main risk with this API is differences between operating systems, in particular Windows.
The design of this API needs to accommodate possible deployment on smaller devices with different operating system models. It should also take into account environments where multiple Java virtual machines are running in the same operating system process. These considerations could lead to a more abstract API and/or increase the design effort.
- blocks
-
JDK-8044122 MBean access to the PID
- Resolved
-
JDK-8044840 [TESTBUG] get rid of JMX in com.oracle.java.testlibrary.ProcessTools.getProcessId() for getting current process id
- Closed
- is blocked by
-
JDK-8077089 JEP-JDK-8046092: Test Task: Process API Updates
- Closed
-
JDK-8077350 JEP 102 Process API Updates Implementation
- Resolved
- relates to
-
JDK-8074569 Update implementation to use ProcessHandle.current() to get the PID
- Closed
-
JDK-6439432 (process) Access to system-specific process-related APIs
- Open
-
JDK-8003490 (process) Provide Process.getCurrentPid() to get identifier of current process
- Resolved
-
JDK-6447323 (process) Native OS process information and control
- Closed
-
JDK-4076796 (process) Provide Process.isAlive(), like Thread.isAlive()
- Closed
-
JDK-4333183 (process) Add a way to gently shutdown, as opposed to destroy, a subprocess
- Closed
-
JDK-4890847 (process) Add Process.ID and Process.waitFor(long timeout)
- Closed
-
JDK-8066847 jdk/test/lib/testlibrary/jdk/testlibrary/ProcessTools.java, to eliminate dependency on sun.management.VMManagement
- Closed
-
JDK-8075621 JEP 279: Improve Test-Failure Troubleshooting
- Closed
1.
|
JEP-JDK-8046092: Test Task: Process API Updates | Closed | Tristan Yan (Inactive) |
|
2015-07-17 | ||||||||
2.
|
Update with final design detail | Resolved | Roger Riggs |