Package com.github.mike10004.xvfbmanager
Class DefaultDisplayReadinessChecker
- java.lang.Object
-
- com.github.mike10004.xvfbmanager.DefaultDisplayReadinessChecker
-
- All Implemented Interfaces:
XvfbManager.DisplayReadinessChecker
public class DefaultDisplayReadinessChecker extends Object implements XvfbManager.DisplayReadinessChecker
Class that calls an X program to gather information about a display in order to determine whether the display is ready. Executesxdpyinfo, specifying the-displayargument, and interprets a clean exit to indicate that the display is ready.
-
-
Constructor Summary
Constructors Constructor Description DefaultDisplayReadinessChecker(io.github.mike10004.subprocess.ProcessTracker processTracker)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckReadiness(String display)Checks display readiness.protected voidexecutedCheckProgram(io.github.mike10004.subprocess.ProcessResult<String,String> result)static Iterable<String>getRequiredPrograms()protected static booleanisCorrectOutputForDisplay(String stdout, String requiredDisplay)protected booleanrepresentsReady(io.github.mike10004.subprocess.ProcessResult<String,String> result, String requiredDisplay)
-
-
-
Method Detail
-
checkReadiness
public boolean checkReadiness(String display)
Checks display readiness. Executesxdpyinfoand returns true on a clean exit code.- Specified by:
checkReadinessin interfaceXvfbManager.DisplayReadinessChecker- Parameters:
display- the display to check, e.g. ":123"- Returns:
- true iff
xdpyinfoexits clean
-
representsReady
protected boolean representsReady(io.github.mike10004.subprocess.ProcessResult<String,String> result, String requiredDisplay)
-
isCorrectOutputForDisplay
protected static boolean isCorrectOutputForDisplay(String stdout, String requiredDisplay)
-
-