Package org.apache.jena.dboe.sys
Class ProcessUtils
- java.lang.Object
-
- org.apache.jena.dboe.sys.ProcessUtils
-
public class ProcessUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ProcessUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetPid(int fallback)Tries to get the PID of the current process caching it for future calls since it won't change throughout the life of the processstatic booleanisAlive(int pid)Determines whether a given PID is alivestatic booleannegativePidsTreatedAsAlive()Gets whether the platform we are running on will cause us to treat negative (i.e.
-
-
-
Method Detail
-
getPid
public static int getPid(int fallback)
Tries to get the PID of the current process caching it for future calls since it won't change throughout the life of the process- Parameters:
fallback- Fallback PID to return if unable to determine the PID i.e. an error code to return- Returns:
- PID of current process or provided
fallbackif unable to determine PID
-
isAlive
public static boolean isAlive(int pid)
Determines whether a given PID is alive- Parameters:
pid- PID- Returns:
- True if the given PID is alive or unknown, false if it is dead
-
negativePidsTreatedAsAlive
public static boolean negativePidsTreatedAsAlive()
Gets whether the platform we are running on will cause us to treat negative (i.e. invalid) PIDs as alive because of the format in which the command line process monitor application for the system returns errors for invalid PIDs- Returns:
- True if a negative PID is treated as alive on this platform or we cannot determine liveness for PIDs on this platform, false otherwise
-
-