Interface Deadline

  • All Known Implementing Classes:
    TcpConx.TcpDeadline

    public interface Deadline
    Support external event timing operations.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      long getDeadline​(long now)
      Implementing objects communicate their timing requirements and trigger timed operations using this method.
    • Method Detail

      • getDeadline

        long getDeadline​(long now)
        Implementing objects communicate their timing requirements and trigger timed operations using this method. The object creator must have infrastructure to call this method after creation, then repeatedly as close to the requested timestamps as practical. Infrastructure is allowed to call this method early to re-evaluate the next timestamp requirement. Implementors must check the supplied 'now' timestamp to verify that a timed operation is appropriate. Implementations may make no assumptions about the thread environment or object synchronization.
        Parameters:
        now - System.nanotime() to be used in the calculations.
        Returns:
        The absolute System.nanoTime() of the next event needed by the implementation. Return Long.MAX_VALUE if no further events are required.