Class BaseMemoizedRefreshableSupplier<T>

java.lang.Object
io.datarouter.instrumentation.refreshable.BaseMemoizedRefreshableSupplier<T>
All Implemented Interfaces:
Refreshable, RefreshableSupplier<T>, Supplier<T>
Direct Known Subclasses:
RefreshableStringSupplier

public abstract class BaseMemoizedRefreshableSupplier<T> extends Object implements RefreshableSupplier<T>
  • Field Details

    • DEFAULT_ATTEMPT_INTERVAL

      public static final Duration DEFAULT_ATTEMPT_INTERVAL
  • Constructor Details

    • BaseMemoizedRefreshableSupplier

      public BaseMemoizedRefreshableSupplier(Duration minimumTtl)
    • BaseMemoizedRefreshableSupplier

      public BaseMemoizedRefreshableSupplier(Duration minimumTtl, Duration attemptInterval)
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface Supplier<T>
    • refresh

      public Instant refresh()
      Description copied from interface: Refreshable
      attempt to refresh this, resulting in a mutation if conditions permit
      Specified by:
      refresh in interface Refreshable
      Returns:
      the last Instant when this was mutated
    • readNewValue

      protected abstract T readNewValue()
    • getIdentifier

      protected abstract String getIdentifier()