Class TimeoutRefresh

  • All Implemented Interfaces:
    RefreshPolicy

    @NotThreadSafe
    public class TimeoutRefresh
    extends java.lang.Object
    implements RefreshPolicy
    A refresh policy which allows refreshing after a specified timeout is reached.
    • Constructor Summary

      Constructors 
      Constructor Description
      TimeoutRefresh​(long refreshPeriodMs)
      Constructs a refresh facility which allows refreshing after a specified timeout is reached.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean attempt()
      Checks if it is time to perform the next refresh and returns immediately.
      • Methods inherited from class java.lang.Object

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

      • TimeoutRefresh

        public TimeoutRefresh​(long refreshPeriodMs)
        Constructs a refresh facility which allows refreshing after a specified timeout is reached.
        Parameters:
        refreshPeriodMs - period of time to refresh after, in milliseconds
    • Method Detail

      • attempt

        public boolean attempt()
        Description copied from interface: RefreshPolicy
        Checks if it is time to perform the next refresh and returns immediately.
        Specified by:
        attempt in interface RefreshPolicy
        Returns:
        whether a refresh should be performed