Class HazelcastAsyncHybridCachedReference<V>

java.lang.Object
com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
com.atlassian.cache.hazelcast.HazelcastAsyncHybridCachedReference<V>
All Implemented Interfaces:
com.atlassian.cache.CachedReference<V>, com.atlassian.cache.ManagedCache

public class HazelcastAsyncHybridCachedReference<V> extends ManagedHybridCacheSupport implements com.atlassian.cache.CachedReference<V>
Implementation of ManagedCache and CachedReference that can be used when the cached value does not implement Serializable but reference invalidation must work cluster-wide. It works by caching the value locally and broadcasting invalidations cluster-wide using a Hazelcast ITopic.
Since:
2.12.0
  • Constructor Details

    • HazelcastAsyncHybridCachedReference

      public HazelcastAsyncHybridCachedReference(String name, com.atlassian.cache.CacheFactory localFactory, com.hazelcast.topic.ITopic<com.atlassian.cache.impl.ReferenceKey> topic, com.atlassian.cache.Supplier<V> supplier, HazelcastCacheManager cacheManager, com.atlassian.cache.CacheSettings settings)
  • Method Details

    • get

      @Nonnull public V get()
      Specified by:
      get in interface com.atlassian.cache.CachedReference<V>
    • isFlushable

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

      public boolean isReplicateAsynchronously()
      Specified by:
      isReplicateAsynchronously in interface com.atlassian.cache.ManagedCache
    • reset

      public void reset()
      Specified by:
      reset in interface com.atlassian.cache.CachedReference<V>
    • isPresent

      public boolean isPresent()
      Specified by:
      isPresent in interface com.atlassian.cache.CachedReference<V>
    • getIfPresent

      @Nonnull public Optional<V> getIfPresent()
      Specified by:
      getIfPresent in interface com.atlassian.cache.CachedReference<V>
    • getLocalCache

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

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

      public boolean updateMaxEntries(int newValue)
      Specified by:
      updateMaxEntries in interface com.atlassian.cache.ManagedCache
      Overrides:
      updateMaxEntries in class ManagedHybridCacheSupport
    • addListener

      public void addListener(@Nonnull com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues)
      Specified by:
      addListener in interface com.atlassian.cache.CachedReference<V>
    • removeListener

      public void removeListener(@Nonnull com.atlassian.cache.CachedReferenceListener<V> listener)
      Specified by:
      removeListener in interface com.atlassian.cache.CachedReference<V>