Package org.apache.maven.surefire.booter
Class PpidChecker
java.lang.Object
org.apache.maven.surefire.booter.PpidChecker
Recognizes PID of Plugin process and determines lifetime.
- Since:
- 2.20.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final Patternprivate static final longprivate ProcessInfoprivate final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate booleanprivate static final String(package private) static final PatternThe etime is in the form of [[dd-]hh:]mm:ss on Unix like systems.private static final Stringprivate static final Stringprivate static final SimpleDateFormatprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static booleanprivate static boolean(package private) static boolean(package private) booleancanUse()private voidprivate static voidcheckValid(Scanner scanner) private static SimpleDateFormatThe 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(package private) static longfromBusyboxHours(Matcher matcher) (package private) static longfromBusyboxMinutes(Matcher matcher) (package private) static StringfromBusyboxPID(Matcher matcher) (package private) static long(package private) static long(package private) static longfromMinutes(Matcher matcher) (package private) static String(package private) static longfromSeconds(Matcher matcher) private static boolean(package private) booleanThis method can be called only aftercanUse()has returnedtrue.(package private) booleanvoidstop()toString()(package private) ProcessInfounix()private static String(package private) ProcessInfowindows()
-
Field Details
-
MINUTES_TO_MILLIS
private static final long MINUTES_TO_MILLIS- See Also:
-
WMIC_CREATION_DATE_VALUE_LENGTH
private static final int WMIC_CREATION_DATE_VALUE_LENGTH- See Also:
-
WMIC_CREATION_DATE_TIMESTAMP_LENGTH
private static final int WMIC_CREATION_DATE_TIMESTAMP_LENGTH- See Also:
-
WMIC_CREATION_DATE_FORMAT
-
WMIC_CREATION_DATE
- See Also:
-
WINDOWS_SYSTEM_ROOT_ENV
- See Also:
-
RELATIVE_PATH_TO_WMIC
- See Also:
-
SYSTEM_PATH_TO_WMIC
- See Also:
-
PS_ETIME_HEADER
- See Also:
-
PS_PID_HEADER
- See Also:
-
destroyableCommands
-
UNIX_CMD_OUT_PATTERN
The etime is in the form of [[dd-]hh:]mm:ss on Unix like systems. See the workaround https://issues.apache.org/jira/browse/SUREFIRE-1451. -
BUSYBOX_CMD_OUT_PATTERN
-
ppid
-
parentProcessInfo
-
stopped
private volatile boolean stopped
-
-
Constructor Details
-
PpidChecker
-
-
Method Details
-
canUse
boolean canUse() -
isProcessAlive
boolean isProcessAlive()This method can be called only aftercanUse()has returnedtrue.- Returns:
trueif parent process is alive;falseotherwise- Throws:
IllegalStateException- ifcanUse()returnsfalse, error to read process or this object has beendestroyedNullPointerException- if extracted e-time is null
-
checkProcessInfo
private void checkProcessInfo() -
unix
ProcessInfo unix() -
windows
ProcessInfo windows() -
destroyActiveCommands
void destroyActiveCommands() -
isStopped
boolean isStopped() -
unixPathToPS
-
canExecuteUnixPs
static boolean canExecuteUnixPs() -
canExecuteLocalUnixPs
private static boolean canExecuteLocalUnixPs() -
canExecuteStandardUnixPs
private static boolean canExecuteStandardUnixPs() -
hasWmicStandardSystemPath
private static boolean hasWmicStandardSystemPath() -
fromDays
-
fromHours
-
fromMinutes
-
fromSeconds
-
fromPID
-
fromBusyboxHours
-
fromBusyboxMinutes
-
fromBusyboxPID
-
checkValid
- Throws:
IOException
-
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.- Returns:
- Windows WMIC format yyyymmddHHMMSS.xxx
-
stop
public void stop() -
toString
-