Class EventHandlingImpl<K,​V>

  • Type Parameters:
    K - key type
    V - value type
    All Implemented Interfaces:
    EventListener, org.cache2k.event.CacheClosedListener, org.cache2k.event.CacheLifecycleListener, EventHandling<K,​V>

    public class EventHandlingImpl<K,​V>
    extends Object
    implements EventHandling<K,​V>, org.cache2k.event.CacheClosedListener
    cache2k does not support changing the listener configuration at runtime. Registers one listener for each event type to cache2k and delivers them to the JCache listeners. Synchronous events are delivered sequentially. Asynchronous events are delivered by an executor and get maximum parallelism.
    Author:
    Jens Wilke
    See Also:
    AsyncDispatcher
    • Method Detail

      • deregisterListener

        public boolean deregisterListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> cfg)
        Specified by:
        deregisterListener in interface EventHandling<K,​V>
      • onCacheClosed

        @Nullable
        public @Nullable CompletableFuture<Void> onCacheClosed​(org.cache2k.Cache cache)
        Copy to a set first, because some listener instances may implement multiple interfaces and show up in the all listeners list more then once
        Specified by:
        onCacheClosed in interface org.cache2k.event.CacheClosedListener
        Parameters:
        cache - The cache that is closing. No cache operations on entries are allowed.
        Returns:
      • registerListener

        public void registerListener​(javax.cache.configuration.CacheEntryListenerConfiguration<K,​V> cfg)
        Specified by:
        registerListener in interface EventHandling<K,​V>