Class NonBlockingCacheEventListener<K,V>

java.lang.Object
org.wildfly.clustering.cache.infinispan.embedded.listener.NonBlockingCacheEventListener<K,V>
Type Parameters:
K - cache key type
V - cache value type
All Implemented Interfaces:
Consumer<org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V>>, Function<org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V>, CompletionStage<Void>>
Direct Known Subclasses:
BlockingCacheEventListener

public class NonBlockingCacheEventListener<K,V> extends Object implements Function<org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V>, CompletionStage<Void>>, Consumer<org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V>>
Generic non-blocking event listener that delegates to a non-blocking event consumer.
Author:
Paul Ferraro
  • Constructor Details

    • NonBlockingCacheEventListener

      public NonBlockingCacheEventListener(Consumer<K> consumer)
      Creates a blocking cache event listener.
      Parameters:
      consumer - a consumer for a given event
    • NonBlockingCacheEventListener

      public NonBlockingCacheEventListener(BiConsumer<K,V> consumer)
      Creates a blocking cache event listener.
      Parameters:
      consumer - a consumer for a given event
  • Method Details

    • apply

      public CompletionStage<Void> apply(org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V> event)
      Specified by:
      apply in interface Function<K,V>
    • accept

      public void accept(org.infinispan.notifications.cachelistener.event.CacheEntryEvent<K,V> event)
      Specified by:
      accept in interface Consumer<K>