Class CacheLocality

java.lang.Object
org.wildfly.clustering.infinispan.distribution.CacheLocality
All Implemented Interfaces:
Locality

public class CacheLocality extends Object implements Locality
A Locality implementation that delegates to either a ConsistentHashLocality or SimpleLocality depending on the cache mode. Instances of this object should not be retained for longer than a single unit of work, since this object holds a final reference to the current ConsistentHash, which will become stale on topology change.
Author:
Paul Ferraro
  • Constructor Details

    • CacheLocality

      public CacheLocality(org.infinispan.Cache<?,?> cache)
  • Method Details

    • isLocal

      public boolean isLocal(Object key)
      Description copied from interface: Locality
      Indicates whether the current node is the primary owner of the specified cache key. For local caches, this method will always return true.
      Specified by:
      isLocal in interface Locality
      Parameters:
      key - a cache key
      Returns:
      true, if the current node is the primary owner of the specified cache key, false otherwise