Class CacheRegistry<K,V>

java.lang.Object
org.wildfly.clustering.server.infinispan.registry.CacheRegistry<K,V>
Type Parameters:
K - key type
V - value type
All Implemented Interfaces:
AutoCloseable, CacheContainerRegistry<K,V>, org.wildfly.clustering.server.Registrar<org.wildfly.clustering.server.registry.RegistryListener<K,V>>, org.wildfly.clustering.server.registry.Registry<CacheContainerGroupMember, K, V>

public class CacheRegistry<K,V> extends Object implements CacheContainerRegistry<K,V>
Clustered Registry backed by an Infinispan cache.
Author:
Paul Ferraro
  • Constructor Details

    • CacheRegistry

      public CacheRegistry(CacheRegistry.Configuration<K,V> configuration)
      Creates a cache registry using the specified configuration.
      Parameters:
      configuration - the configuration of this registry.
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface org.wildfly.clustering.server.registry.Registry<CacheContainerGroupMember, K, V>
    • register

      public org.wildfly.clustering.server.Registration register(org.wildfly.clustering.server.registry.RegistryListener<K,V> listener)
      Specified by:
      register in interface org.wildfly.clustering.server.Registrar<K>
    • getGroup

      public CacheContainerGroup getGroup()
      Specified by:
      getGroup in interface CacheContainerRegistry<K,V>
      Specified by:
      getGroup in interface org.wildfly.clustering.server.registry.Registry<CacheContainerGroupMember, K, V>
    • getEntries

      public Map<K,V> getEntries()
      Specified by:
      getEntries in interface org.wildfly.clustering.server.registry.Registry<CacheContainerGroupMember, K, V>
    • getEntry

      public Map.Entry<K,V> getEntry(CacheContainerGroupMember member)
      Specified by:
      getEntry in interface org.wildfly.clustering.server.registry.Registry<CacheContainerGroupMember, K, V>
    • topologyChanged

      public CompletionStage<Void> topologyChanged(org.infinispan.notifications.cachelistener.event.TopologyChangedEvent<org.infinispan.remoting.transport.Address, Map.Entry<K,V>> event)
      Non-blocking handler of topology changed events.
      Parameters:
      event - a topology changed event.
      Returns:
      a completion stage
    • event

      public CompletionStage<Void> event(org.infinispan.notifications.cachelistener.event.CacheEntryEvent<org.infinispan.remoting.transport.Address, Map.Entry<K,V>> event)
      Non-blocking handler of cache entry creation/modified events.
      Parameters:
      event - a cache entry event.
      Returns:
      a completion stage
    • removed

      public CompletionStage<Void> removed(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent<org.infinispan.remoting.transport.Address, Map.Entry<K,V>> event)
      Non-blocking handler of cache entry removal events.
      Parameters:
      event - a cache entry removal event.
      Returns:
      a completion stage