Interface CacheEntryExpiredListener<K,​V>

  • All Superinterfaces:
    CacheEntryOperationListener<K,​V>, DataAware<K,​V>, EventListener

    public interface CacheEntryExpiredListener<K,​V>
    extends CacheEntryOperationListener<K,​V>
    Listener called when an entry expires.

    The listener is called after an entry logically expired. The An event may be delayed or suppressed if a long running operation is working on the, for example a load or a Cache#computeIfAbsent(Object, Callable). In case a load is triggered by the expiry an expiry event is send before the load is started.

    Author:
    Jens Wilke
    • Method Detail

      • onEntryExpired

        void onEntryExpired​(Cache<K,​V> cache,
                            CacheEntry<K,​V> entry)
                     throws Exception
        Called after the expiry of an entry.
        Parameters:
        cache - Reference to the cache that generated the event.
        entry - Entry containing the last data. It is only valid to access the object during the call of this method. The object value may become invalid afterwards.
        Throws:
        Exception