Interface ITimeoutTask

All Superinterfaces:
ITimerTask
All Known Implementing Classes:
TimeoutTask

public interface ITimeoutTask extends ITimerTask
An interface for a registered timeout task that can be queried for timeout or canceled.
Author:
Christopher Mindus
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    long
    Gets the remaining time before timeout.
    boolean
    Returns whether timeout notification has been called or not.
    boolean
    Verifies if timeout has occurred.
    boolean
    Checks if the task is canceled.

    Methods inherited from interface com.iizix.timeout.ITimerTask Link icon

    cancel, getStartTime
  • Method Details Link icon

    • isCanceled Link icon

      boolean isCanceled()
      Checks if the task is canceled.
      Returns:
      The canceled flag.
    • getRemainingTime Link icon

      long getRemainingTime()
      Gets the remaining time before timeout. This value just keeps on counting, even when the timeout has occurred or the task is stopped.
      Returns:
      A time in milliseconds >= zero indicating the remaining timeout time, or < zero if the task has timed out. The return value is Long.MAX_VALUE if the timeout is indefinite.
    • hasTimedOut Link icon

      boolean hasTimedOut()
      Verifies if timeout has occurred.
      Returns:
      true if the task has timed out, false otherwise.
    • hasNotifiedTimeout Link icon

      boolean hasNotifiedTimeout()
      Returns whether timeout notification has been called or not.
      Returns:
      true if the timeout task has been notified, false otherwise (e.g. task canceled).