java.lang.Object
org.apache.jena.tdb1.sys.ProcessUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 booleanGets whether the platform we are running on will cause us to treat negative (i.e.
-
Constructor Details
-
ProcessUtils
public ProcessUtils()
-
-
Method Details
-
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
-