Class AsyncReplicationCache<K,V>

java.lang.Object
com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
com.atlassian.cache.hazelcast.asyncinvalidation.AsyncReplicationCache<K,V>
All Implemented Interfaces:
com.atlassian.cache.Cache<K,V>, com.atlassian.cache.ManagedCache, com.atlassian.cache.ReadThroughCache<K,V>

public final class AsyncReplicationCache<K,V> extends com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
An implementation of Cache that is backed by a local cache, and which publishes changes to the cache entries via invalidations and replications.
Since:
8.4
See Also:
  • Field Summary

    Fields inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport

    cacheManager, name
  • Constructor Summary

    Constructors
    Constructor
    Description
    AsyncReplicationCache(com.atlassian.cache.Cache<K,V> localCache, com.atlassian.cache.ManagedCache localManagedCache, CacheInvalidator<K> invalidator, CacheReplicator<K,V> replicator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)
     
    void
     
    boolean
     
    get(K key)
     
    get(K key, com.atlassian.cache.Supplier<? extends V> valueSupplier)
     
    getBulk(Set<K> keys, Function<Set<K>,Map<K,V>> valuesSupplier)
     
     
    protected com.atlassian.cache.ManagedCache
     
    boolean
     
    boolean
     
    final boolean
     
    boolean
     
    protected void
     
    protected void
    onPut(K key, V value)
     
    protected void
    onRemove(K key)
     
    void
    put(K key, V value)
     
    putIfAbsent(K key, V value)
     
    void
    remove(K key)
     
    boolean
    remove(K key, V value)
     
    void
     
    void
    removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener)
     
    boolean
    replace(K key, V oldValue, V newValue)
     

    Methods inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport

    currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getName, getStatistics, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWrite, updateMaxEntries

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.atlassian.cache.ManagedCache

    getCacheCollector

    Methods inherited from interface com.atlassian.cache.ReadThroughCache

    getName
  • Constructor Details

    • AsyncReplicationCache

      public AsyncReplicationCache(com.atlassian.cache.Cache<K,V> localCache, com.atlassian.cache.ManagedCache localManagedCache, CacheInvalidator<K> invalidator, CacheReplicator<K,V> replicator)
  • Method Details

    • isReplicateViaCopy

      public boolean isReplicateViaCopy()
      Specified by:
      isReplicateViaCopy in interface com.atlassian.cache.ManagedCache
      Overrides:
      isReplicateViaCopy in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
    • onPut

      protected void onPut(K key, V value)
    • onRemove

      protected void onRemove(K key)
    • onClear

      protected void onClear()
    • clear

      public void clear()
      Specified by:
      clear in interface com.atlassian.cache.ManagedCache
    • isReplicateAsynchronously

      public final boolean isReplicateAsynchronously()
    • put

      public void put(K key, V value)
      Specified by:
      put in interface com.atlassian.cache.Cache<K,V>
    • putIfAbsent

      public V putIfAbsent(K key, V value)
      Specified by:
      putIfAbsent in interface com.atlassian.cache.Cache<K,V>
    • remove

      public void remove(K key)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • remove

      public boolean remove(K key, V value)
      Specified by:
      remove in interface com.atlassian.cache.ReadThroughCache<K,V>
    • removeAll

      public void removeAll()
      Specified by:
      removeAll in interface com.atlassian.cache.ReadThroughCache<K,V>
    • replace

      public boolean replace(K key, V oldValue, V newValue)
      Specified by:
      replace in interface com.atlassian.cache.Cache<K,V>
    • isLocal

      public boolean isLocal()
      Specified by:
      isLocal in interface com.atlassian.cache.ManagedCache
      Overrides:
      isLocal in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
    • getLocalCache

      protected com.atlassian.cache.ManagedCache getLocalCache()
      Specified by:
      getLocalCache in class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
    • isFlushable

      public boolean isFlushable()
      Specified by:
      isFlushable in interface com.atlassian.cache.ManagedCache
    • containsKey

      public boolean containsKey(K key)
      Specified by:
      containsKey in interface com.atlassian.cache.ReadThroughCache<K,V>
    • getKeys

      public Collection<K> getKeys()
      Specified by:
      getKeys in interface com.atlassian.cache.ReadThroughCache<K,V>
    • get

      public V get(K key)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • get

      public V get(K key, com.atlassian.cache.Supplier<? extends V> valueSupplier)
      Specified by:
      get in interface com.atlassian.cache.ReadThroughCache<K,V>
    • getBulk

      public Map<K,V> getBulk(Set<K> keys, Function<Set<K>,Map<K,V>> valuesSupplier)
      Specified by:
      getBulk in interface com.atlassian.cache.ReadThroughCache<K,V>
    • addListener

      public void addListener(com.atlassian.cache.CacheEntryListener<K,V> listener, boolean includeValues)
      Specified by:
      addListener in interface com.atlassian.cache.Cache<K,V>
    • removeListener

      public void removeListener(com.atlassian.cache.CacheEntryListener<K,V> listener)
      Specified by:
      removeListener in interface com.atlassian.cache.Cache<K,V>