Class FixedTimeout

  • All Implemented Interfaces:
    Timeout

    public class FixedTimeout
    extends java.lang.Object
    implements Timeout
    A Timeout of fixed duration from the time the FixedTimeout object is instantiated.
    Author:
    nat
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedTimeout​(long duration)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long timeRemaining()
      Returns the time remaining, to be passed to wait or throws TimeoutException if the timeout has expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedTimeout

        public FixedTimeout​(long duration)
    • Method Detail

      • timeRemaining

        public long timeRemaining()
                           throws java.util.concurrent.TimeoutException
        Description copied from interface: Timeout
        Returns the time remaining, to be passed to wait or throws TimeoutException if the timeout has expired.
        Specified by:
        timeRemaining in interface Timeout
        Throws:
        java.util.concurrent.TimeoutException