Interface CriticalComponent

  • All Known Implementing Classes:
    CriticalComponentImpl

    public interface CriticalComponent
    A 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 Detail

      • 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 expired
        reset - - true to reset the component timer if it is expired
        Returns:
        -1 if it's ok, or the number of the path it failed