org.zeroturnaround.process
Class PidUtil
java.lang.Object
org.zeroturnaround.process.PidUtil
public class PidUtil
- extends Object
Helper methods for retrieving process IDs.
|
Method Summary |
static int |
getMyPid()
Returns process ID of the current JVM. |
static int |
getPid(Process process)
Detects PID from given Process object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PidUtil
public PidUtil()
getMyPid
public static int getMyPid()
- Returns process ID of the current JVM.
- Returns:
- process ID of the current JVM.
getPid
public static int getPid(Process process)
- Detects PID from given
Process object.
An error is thrown if we're unable to detect the PID.
- Parameters:
process - process object (not null).
- Returns:
- detected PID (not
null).
Copyright © 2015 ZeroTurnaround. All rights reserved.