Class HazelcastCacheManager

java.lang.Object
com.atlassian.cache.impl.AbstractCacheManager
com.atlassian.cache.hazelcast.HazelcastCacheManager
All Implemented Interfaces:
com.atlassian.cache.CacheFactory, com.atlassian.cache.CacheManager

@Internal public class HazelcastCacheManager extends com.atlassian.cache.impl.AbstractCacheManager
Hazelcast implementation of the CacheManager contract
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
     

    Fields inherited from class com.atlassian.cache.impl.AbstractCacheManager

    cacheCreationLocks, caches, cacheSettingsDefaultsProvider
  • Constructor Summary

    Constructors
    Constructor
    Description
    HazelcastCacheManager(com.hazelcast.core.HazelcastInstance hazelcast, com.atlassian.cache.CacheFactory localCacheFactory, com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider)
     
    HazelcastCacheManager(com.hazelcast.core.HazelcastInstance hazelcast, com.atlassian.cache.CacheFactory localCacheFactory, com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider, HazelcastNameFactory nameFactory)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkSettingsAreCompatible(String name, com.atlassian.cache.CacheSettings settings)
     
    protected <K, V> com.atlassian.cache.Cache<K,V>
    createAsyncHybridCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
     
    protected <V> com.atlassian.cache.CachedReference<V>
    createAsyncHybridCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
     
    protected <K, V> com.atlassian.cache.ManagedCache
    createComputingCache(String name, com.atlassian.cache.CacheSettings settings, com.atlassian.cache.CacheLoader<K,V> loader)
     
    protected <K, V> com.atlassian.cache.Cache<K,V>
    createDistributedCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
     
    protected <V> com.atlassian.cache.CachedReference<V>
    createDistributedCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
     
    protected <K, V> com.atlassian.cache.Cache<K,V>
    createHybridCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
     
    protected <V> com.atlassian.cache.CachedReference<V>
    createHybridCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
     
    protected com.atlassian.cache.ManagedCache
    createSimpleCache(String name, com.atlassian.cache.CacheSettings settings)
     
    void
    De-registers listeners.
    <V> com.atlassian.cache.CachedReference<V>
    getCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
     
    com.hazelcast.core.HazelcastInstance
     
    void
    Initializes the manager.
    boolean
    updateCacheSettings(String mapName, com.atlassian.cache.CacheSettings newSettings)
    Update the cache settings of an existing cache.

    Methods inherited from class com.atlassian.cache.impl.AbstractCacheManager

    flushCaches, getCache, getCache, getCache, getCache, getCache, getCachedReference, getCachedReference, getCachedReference, getCaches, getManagedCache, getManagedCaches, mergeSettings, shutdown

    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.CacheFactory

    getReadThroughCache, getReadThroughCache
  • Field Details

  • Constructor Details

    • HazelcastCacheManager

      public HazelcastCacheManager(com.hazelcast.core.HazelcastInstance hazelcast, com.atlassian.cache.CacheFactory localCacheFactory, com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider)
    • HazelcastCacheManager

      public HazelcastCacheManager(com.hazelcast.core.HazelcastInstance hazelcast, com.atlassian.cache.CacheFactory localCacheFactory, com.atlassian.cache.CacheSettingsDefaultsProvider cacheSettingsDefaultsProvider, HazelcastNameFactory nameFactory)
  • Method Details

    • getHazelcastInstance

      public com.hazelcast.core.HazelcastInstance getHazelcastInstance()
    • init

      @PostConstruct public void init()
      Initializes the manager. This method must be called after the bean has been created.
    • createComputingCache

      protected <K, V> com.atlassian.cache.ManagedCache createComputingCache(@Nonnull String name, @Nonnull com.atlassian.cache.CacheSettings settings, com.atlassian.cache.CacheLoader<K,V> loader)
      Specified by:
      createComputingCache in class com.atlassian.cache.impl.AbstractCacheManager
    • createSimpleCache

      protected com.atlassian.cache.ManagedCache createSimpleCache(@Nonnull String name, @Nonnull com.atlassian.cache.CacheSettings settings)
      Specified by:
      createSimpleCache in class com.atlassian.cache.impl.AbstractCacheManager
    • destroy

      @PreDestroy public void destroy()
      De-registers listeners. This method must be called when the bean is no longer required.
    • getCachedReference

      @Nonnull public <V> com.atlassian.cache.CachedReference<V> getCachedReference(@Nonnull String name, @Nonnull com.atlassian.cache.Supplier<V> supplier, @Nonnull com.atlassian.cache.CacheSettings settings)
    • checkSettingsAreCompatible

      protected void checkSettingsAreCompatible(String name, com.atlassian.cache.CacheSettings settings)
    • updateCacheSettings

      public boolean updateCacheSettings(@Nonnull String mapName, @Nonnull com.atlassian.cache.CacheSettings newSettings)
      Update the cache settings of an existing cache. Called by ManagedCache methods
      Parameters:
      mapName - The name of the map to update
      newSettings - CacheSettings object representing the new settings
      Returns:
      true if the update succeeded, false otherwise
    • createAsyncHybridCache

      protected <K, V> com.atlassian.cache.Cache<K,V> createAsyncHybridCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
    • createAsyncHybridCachedReference

      protected <V> com.atlassian.cache.CachedReference<V> createAsyncHybridCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
    • createDistributedCache

      protected <K, V> com.atlassian.cache.Cache<K,V> createDistributedCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
    • createDistributedCachedReference

      protected <V> com.atlassian.cache.CachedReference<V> createDistributedCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)
    • createHybridCache

      protected <K, V> com.atlassian.cache.Cache<K,V> createHybridCache(String name, com.atlassian.cache.CacheLoader<K,V> loader, com.atlassian.cache.CacheSettings settings)
    • createHybridCachedReference

      protected <V> com.atlassian.cache.CachedReference<V> createHybridCachedReference(String name, com.atlassian.cache.Supplier<V> supplier, com.atlassian.cache.CacheSettings settings)