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>, Registrar<RegistryListener<K,V>>, 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 Registry<CacheContainerGroupMember, K, V>
    • register

      public Registration register(RegistryListener<K,V> listener)
      Description copied from interface: Registrar
      Registers an object. The object is unregistered when the generated Registration is closed.
      Specified by:
      register in interface Registrar<K>
      Parameters:
      listener - an object to register
      Returns:
      an object registration.
    • getGroup

      public CacheContainerGroup getGroup()
      Description copied from interface: Registry
      Returns the group associated with this factory.
      Specified by:
      getGroup in interface CacheContainerRegistry<K,V>
      Specified by:
      getGroup in interface Registry<CacheContainerGroupMember, K, V>
      Returns:
      a group
    • getEntries

      public Map<K,V> getEntries()
      Description copied from interface: Registry
      Returns all registry entries in this group.
      Specified by:
      getEntries in interface Registry<CacheContainerGroupMember, K, V>
      Returns:
      a map for entries
    • getEntry

      public Map.Entry<K,V> getEntry(CacheContainerGroupMember member)
      Description copied from interface: Registry
      Returns the registry entry for the specified group member.
      Specified by:
      getEntry in interface Registry<CacheContainerGroupMember, K, V>
      Parameters:
      member - a group member
      Returns:
      the registry entry of the specified group member, or null if undefined.
    • 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