@Internal public class HibernateClusterAwareCacheManager extends Object implements com.atlassian.cache.CacheManager, org.springframework.beans.factory.InitializingBean
CacheManager
. Due to how query caching works in Hibernate,
query caches *must* always be flushed whenever timestamp caches are flushed.
This class publishes a cluster event to flush query caches on *each* node when timestamp caches are flushed via CacheManager
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
flushCaches() |
<K,V> @NonNull com.atlassian.cache.Cache<K,V> |
getCache(@NonNull Class<?> owningClass,
@NonNull String name) |
<K,V> @NonNull com.atlassian.cache.Cache<K,V> |
getCache(@NonNull String name) |
<K,V> @NonNull com.atlassian.cache.Cache<K,V> |
getCache(@NonNull String name,
@Nullable com.atlassian.cache.CacheLoader<K,V> loader) |
<K,V> @NonNull com.atlassian.cache.Cache<K,V> |
getCache(@NonNull String name,
@Nullable com.atlassian.cache.CacheLoader<K,V> loader,
@NonNull com.atlassian.cache.CacheSettings required) |
<K,V> @NonNull com.atlassian.cache.Cache<K,V> |
getCache(@NonNull String name,
@NonNull Class<K> keyType,
@NonNull Class<V> valueType) |
<V> @NonNull com.atlassian.cache.CachedReference<V> |
getCachedReference(@NonNull Class<?> owningClass,
@NonNull String name,
@NonNull com.atlassian.cache.Supplier<V> supplier) |
<V> @NonNull com.atlassian.cache.CachedReference<V> |
getCachedReference(@NonNull Class<?> owningClass,
@NonNull String name,
@NonNull com.atlassian.cache.Supplier<V> supplier,
@NonNull com.atlassian.cache.CacheSettings required) |
<V> @NonNull com.atlassian.cache.CachedReference<V> |
getCachedReference(@NonNull String name,
@NonNull com.atlassian.cache.Supplier<V> supplier) |
<V> @NonNull com.atlassian.cache.CachedReference<V> |
getCachedReference(@NonNull String name,
@NonNull com.atlassian.cache.Supplier<V> supplier,
@NonNull com.atlassian.cache.CacheSettings required) |
@NonNull Collection<com.atlassian.cache.Cache<?,?>> |
getCaches() |
@Nullable com.atlassian.cache.ManagedCache |
getManagedCache(@NonNull String name) |
@NonNull Collection<com.atlassian.cache.ManagedCache> |
getManagedCaches() |
void |
onClusterCacheFlush(ClusterEventWrapper wrapper)
Timestamp cache region has been flushed, time to flush all local query caches.
|
void |
shutdown() |
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
@EventListener public void onClusterCacheFlush(ClusterEventWrapper wrapper)
public @NonNull Collection<com.atlassian.cache.Cache<?,?>> getCaches()
getCaches
in interface com.atlassian.cache.CacheManager
public @NonNull Collection<com.atlassian.cache.ManagedCache> getManagedCaches()
getManagedCaches
in interface com.atlassian.cache.CacheManager
public void flushCaches()
flushCaches
in interface com.atlassian.cache.CacheManager
public @Nullable com.atlassian.cache.ManagedCache getManagedCache(@NonNull String name)
getManagedCache
in interface com.atlassian.cache.CacheManager
public void shutdown()
shutdown
in interface com.atlassian.cache.CacheManager
public <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference(@NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier)
getCachedReference
in interface com.atlassian.cache.CacheFactory
public <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference(@NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier, @NonNull com.atlassian.cache.CacheSettings required)
getCachedReference
in interface com.atlassian.cache.CacheFactory
public <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference(@NonNull Class<?> owningClass, @NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier)
getCachedReference
in interface com.atlassian.cache.CacheFactory
public <V> @NonNull com.atlassian.cache.CachedReference<V> getCachedReference(@NonNull Class<?> owningClass, @NonNull String name, @NonNull com.atlassian.cache.Supplier<V> supplier, @NonNull com.atlassian.cache.CacheSettings required)
getCachedReference
in interface com.atlassian.cache.CacheFactory
public <K,V> @NonNull com.atlassian.cache.Cache<K,V> getCache(@NonNull String name)
getCache
in interface com.atlassian.cache.CacheFactory
public <K,V> @NonNull com.atlassian.cache.Cache<K,V> getCache(@NonNull Class<?> owningClass, @NonNull String name)
getCache
in interface com.atlassian.cache.CacheFactory
public <K,V> @NonNull com.atlassian.cache.Cache<K,V> getCache(@NonNull String name, @Nullable com.atlassian.cache.CacheLoader<K,V> loader)
getCache
in interface com.atlassian.cache.CacheFactory
public <K,V> @NonNull com.atlassian.cache.Cache<K,V> getCache(@NonNull String name, @Nullable com.atlassian.cache.CacheLoader<K,V> loader, @NonNull com.atlassian.cache.CacheSettings required)
getCache
in interface com.atlassian.cache.CacheFactory
Copyright © 2003–2021 Atlassian. All rights reserved.