Class TimeoutManager


  • public class TimeoutManager
    extends Object
    Author:
    Emmanuel Bernard
    • Method Detail

      • start

        public void start()
        we start counting from this method call (if needed)
      • stop

        public void stop()
      • remainingTimeToHardTimeout

        public Long remainingTimeToHardTimeout()
        If no hard timeout is defined, returns null.
        Returns:
        the remaining time to hard timeout in milliseconds
        Throws:
        SearchTimeoutException - If the timeout was reached and a hard timeout was requested.
      • timeoutBaseline

        public long timeoutBaseline()
      • checkTimeLeftInMilliseconds

        public Long checkTimeLeftInMilliseconds()
        Returns:
        true if the timeout was reached, false otherwise.
        Throws:
        SearchTimeoutException - If the timeout was reached and a hard timeout was requested.
      • isTimedOut

        public boolean isTimedOut()
        Returns:
        true if the timeout was reached in a previous call to checkTimedOut(), false otherwise.
      • checkTimedOut

        public boolean checkTimedOut()
        Returns:
        true if the timeout was reached, false otherwise.
        Throws:
        SearchTimeoutException - If the timeout was reached and a hard timeout was requested.
      • forceTimedOut

        public void forceTimedOut()
      • hasHardTimeout

        public boolean hasHardTimeout()
      • onTimedOut

        protected void onTimedOut()
      • elapsedTimeInMilliseconds

        protected long elapsedTimeInMilliseconds()