final class PpidChecker
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
PpidChecker.ProcessInfoConsumer
Reads standard output from
Process . |
Modifier and Type | Field and Description |
---|---|
private java.util.Queue<java.lang.Process> |
destroyableCommands |
private static int |
MINUTES_TO_MILLIS |
private ProcessInfo |
parentProcessInfo |
private long |
ppid |
private static java.lang.String |
RELATIVE_PATH_TO_WMIC |
private boolean |
stopped |
private static java.lang.String |
SYSTEM_PATH_TO_WMIC |
(package private) static java.util.regex.Pattern |
UNIX_CMD_OUT_PATTERN
The etime is in the form of [[dd-]hh:]mm:ss on Unix like systems.
|
private static java.lang.String |
WINDOWS_SYSTEM_ROOT_ENV |
private static java.lang.String |
WMIC_CREATION_DATE |
private static java.text.SimpleDateFormat |
WMIC_CREATION_DATE_FORMAT |
private static int |
WMIC_CREATION_DATE_TIMESTAMP_LENGTH |
private static int |
WMIC_CREATION_DATE_VALUE_LENGTH |
Constructor and Description |
---|
PpidChecker(long ppid) |
Modifier and Type | Method and Description |
---|---|
private static boolean |
canExecuteLocalUnixPs() |
private static boolean |
canExecuteStandardUnixPs() |
(package private) static boolean |
canExecuteUnixPs() |
(package private) boolean |
canUse() |
private void |
checkProcessInfo() |
private static void |
checkValid(java.util.Scanner scanner) |
private static java.text.SimpleDateFormat |
createWindowsCreationDateFormat()
The beginning part of Windows WMIC format yyyymmddHHMMSS.xxx
https://technet.microsoft.com/en-us/library/ee198928.aspx We use UTC time zone which avoids DST changes, see SUREFIRE-1512. |
(package private) void |
destroyActiveCommands() |
(package private) static long |
fromDays(java.util.regex.Matcher matcher) |
(package private) static long |
fromHours(java.util.regex.Matcher matcher) |
(package private) static long |
fromMinutes(java.util.regex.Matcher matcher) |
(package private) static long |
fromSeconds(java.util.regex.Matcher matcher) |
private static boolean |
hasWmicStandardSystemPath() |
(package private) boolean |
isProcessAlive()
This method can be called only after
canUse() has returned true . |
private boolean |
isStopped() |
(package private) ProcessInfo |
unix() |
private static java.lang.String |
unixPathToPS() |
(package private) ProcessInfo |
windows() |
private static final int MINUTES_TO_MILLIS
private static final int WMIC_CREATION_DATE_VALUE_LENGTH
private static final int WMIC_CREATION_DATE_TIMESTAMP_LENGTH
private static final java.text.SimpleDateFormat WMIC_CREATION_DATE_FORMAT
private static final java.lang.String WMIC_CREATION_DATE
private static final java.lang.String WINDOWS_SYSTEM_ROOT_ENV
private static final java.lang.String RELATIVE_PATH_TO_WMIC
private static final java.lang.String SYSTEM_PATH_TO_WMIC
private final java.util.Queue<java.lang.Process> destroyableCommands
static final java.util.regex.Pattern UNIX_CMD_OUT_PATTERN
private final long ppid
private volatile ProcessInfo parentProcessInfo
private volatile boolean stopped
boolean canUse()
boolean isProcessAlive()
canUse()
has returned true
.private void checkProcessInfo()
ProcessInfo unix()
ProcessInfo windows()
void destroyActiveCommands()
private boolean isStopped()
private static java.lang.String unixPathToPS()
static boolean canExecuteUnixPs()
private static boolean canExecuteLocalUnixPs()
private static boolean canExecuteStandardUnixPs()
private static boolean hasWmicStandardSystemPath()
static long fromDays(java.util.regex.Matcher matcher)
static long fromHours(java.util.regex.Matcher matcher)
static long fromMinutes(java.util.regex.Matcher matcher)
static long fromSeconds(java.util.regex.Matcher matcher)
private static void checkValid(java.util.Scanner scanner) throws java.io.IOException
java.io.IOException
private static java.text.SimpleDateFormat createWindowsCreationDateFormat()