JEP 102 Process Updates revised API draft
David M. Lloyd
david.lloyd at redhat.com
Mon Feb 9 23:44:37 UTC 2015
On 02/09/2015 05:25 PM, Roger Riggs wrote:
> Hi,
>
> After a protracted absence from working on JEP 102, the updated API draft
> provides access to process hierarchies and individual process information;
> as permitted by the OS. The relationship between Process and ProcessHandle
> is clarified and the security model validated.
>
> Both Processes and ProcessHandles can be monitored using CompletableFuture
> for termination and to trigger additional actions on Process exit.
> Information about processes includes the total cputime, starttime, user,
> executable, and arguments.
>
> Please review and comment:
> http://cr.openjdk.java.net/~rriggs/ph-apidraft/
Great, I'm glad to see this come to fruition. I have a couple minor
questions though.
ProcessHandle.Info provides a startTime and totalTime. But it seems odd
and inconsistent that startTime is an Instant, yet totalTime is a raw
long as opposed to the arguably more consistent Duration. Is there a
reason you went with a raw long for this property?
Also, as a general comment, there isn't really a good explanation as to
what the difference is between a normal destroy and a forcible destroy.
Given that you've added an isDestroyForcible() method, I think it
might be a good idea to explain what it means when this method returns
true. There must be some criteria in the implementation to return true
here, so at the least, that criteria should be explained. Also the
destroy() method now has the odd characteristic that its implementation
*may* forcibly destroy a process, but you can't really determine that
from the API at all.
--
- DML
More information about the core-libs-dev
mailing list