Class ExpiryHandlerImpl

    • Constructor Detail

      • ExpiryHandlerImpl

        public ExpiryHandlerImpl​(@NotNull
                                 @NotNull Expirable expiring,
                                 @NotNull
                                 @NotNull Duration timeToIdle,
                                 @NotNull
                                 @NotNull ExpiryTicker expiryTicker)
    • Method Detail

      • onCreate

        public void onCreate()
        Description copied from interface: ExpiryHandler
        Called when an expirable object is created/recreated.
        Specified by:
        onCreate in interface ExpiryHandler
      • onUse

        public void onUse()
        Description copied from interface: ExpiryHandler
        Called when an expirable object is used.
        Specified by:
        onUse in interface ExpiryHandler
      • expiryTick

        public long expiryTick()
        Description copied from interface: ExpiryHandler
        Called periodically by ExpiryTicker. Should be used to expire the object if it's too old.
        Specified by:
        expiryTick in interface ExpiryHandler
        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.