Class HazelcastHybridCachedReference<V>

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

public class HazelcastHybridCachedReference<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.
Since:
2.4.0
  • Constructor Details

    • HazelcastHybridCachedReference

      public HazelcastHybridCachedReference(String name, com.atlassian.cache.CacheFactory localFactory, com.hazelcast.map.IMap<com.atlassian.cache.impl.ReferenceKey,Long> versionMap, com.atlassian.cache.Supplier<V> supplier, HazelcastCacheManager cacheManager)
  • 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>