Interface CriticalComponent
-
- All Known Implementing Classes:
CriticalComponentImpl
public interface CriticalComponentA Critical component enters and leaves a critical state. You update a long every time you enter a critical path you update a different long with a System.nanoTime every time you leave that path. If the enterCritical > leaveCritical at any point, then you need to measure the timeout. if the system stops responding, then you have something irresponsive at the system.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancheckExpiration(long timeout, boolean reset)Check if the component is expired at a given timeout..CriticalAnalyzergetCriticalAnalyzer()CriticalCloseablemeasureCritical(int path)
-
-
-
Method Detail
-
getCriticalAnalyzer
CriticalAnalyzer getCriticalAnalyzer()
-
measureCritical
CriticalCloseable measureCritical(int path)
-
checkExpiration
boolean checkExpiration(long timeout, boolean reset)Check if the component is expired at a given timeout.. on any of its paths.- Parameters:
timeout- - the timeout to check if the component is expiredreset- - true to reset the component timer if it is expired- Returns:
- -1 if it's ok, or the number of the path it failed
-
-