Interface ExpiryHandler

All Known Implementing Classes:
ExpiryHandlerImpl, GuavaCacheLazyExpiryHandler, LazyExpiryHandler

public interface ExpiryHandler
Interface used to keeps tabs/control an expirable element.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Called periodically by ExpiryTicker.
    void
    Called when an expirable object is created/recreated.
    void
    Called when an expirable object is used.
  • Method Details

    • onCreate

      void onCreate()
      Called when an expirable object is created/recreated.
    • onUse

      void onUse()
      Called when an expirable object is used.
    • expiryTick

      long expiryTick()
      Called periodically by ExpiryTicker. Should be used to expire the object if it's too old.
      Returns:
      -1 if the object has been expired. 0 if it has not been expired. Optionally, can return the nearest timestamp when the object may be expired.