Process API Updates (JEP 102)

David M. Lloyd david.lloyd at redhat.com
Tue Mar 25 12:17:06 UTC 2014


On 03/24/2014 04:11 PM, roger riggs wrote:
> Hi,
>
> I'm starting to work on JEP 102, Process API Updates for JDK 9.
> The use cases identified include test execution and build systems such
> as Jtreg and Hudson/Jenkins. And there is a use-case for using Java
> to monitor the health of a more complex system where the processes
> are not spawned by the same manager.
>
> The current API of Process itself is pretty complete with the addition
> of a getPid
> method to enable identification of subprocesses spawned by the application
> and allow external identification.  It will not be possible to intercept
> the input,
> output and error streams of an arbitrary process.
>
>  From the scope of the JEP, a fairly simple API seems sufficient.
>   - Enumerate the direct children
>   - The rest of the functions are similar to Process
>     - to terminate a process, forcibly and normally
>     - to destroy a process and all of its children recursively
>     - to check if one is alive
>     - to waitFor for termination and retrieve the exit status
>
> Are there use cases for which this is insufficient?  Please comment.

There are two features we would definitely like to see added:

1) NIO Channel interface for process streams
2) The ability to pass additional channels to child processes

#1 seems relatively straightforward, but admittedly it's not clear how 
#2 might be possible from the child process side.


-- 
- DML



More information about the core-libs-dev mailing list