Package com.atlassian.cache.hazelcast
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
-
Field Summary
Fields inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
cacheManager, name -
Constructor Summary
ConstructorsConstructorDescriptionHazelcastAsyncHybridCachedReference(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 Summary
Modifier and TypeMethodDescriptionvoidaddListener(com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues) voidclear()get()protected com.atlassian.cache.ManagedCachebooleanbooleanbooleanvoidremoveListener(com.atlassian.cache.CachedReferenceListener<V> listener) voidreset()booleanupdateMaxEntries(int newValue) Methods inherited from class com.atlassian.cache.hazelcast.ManagedHybridCacheSupport
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getName, getStatistics, isLocal, isReplicateViaCopy, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWriteMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.cache.ManagedCache
getCacheCollector
-
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
- Specified by:
getin interfacecom.atlassian.cache.CachedReference<V>
-
isFlushable
public boolean isFlushable()- Specified by:
isFlushablein interfacecom.atlassian.cache.ManagedCache
-
isReplicateAsynchronously
public boolean isReplicateAsynchronously()- Specified by:
isReplicateAsynchronouslyin interfacecom.atlassian.cache.ManagedCache
-
reset
public void reset()- Specified by:
resetin interfacecom.atlassian.cache.CachedReference<V>
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfacecom.atlassian.cache.CachedReference<V>
-
getIfPresent
- Specified by:
getIfPresentin interfacecom.atlassian.cache.CachedReference<V>
-
getLocalCache
protected com.atlassian.cache.ManagedCache getLocalCache()- Specified by:
getLocalCachein classManagedHybridCacheSupport
-
clear
public void clear()- Specified by:
clearin interfacecom.atlassian.cache.ManagedCache
-
updateMaxEntries
public boolean updateMaxEntries(int newValue) - Specified by:
updateMaxEntriesin interfacecom.atlassian.cache.ManagedCache- Overrides:
updateMaxEntriesin classManagedHybridCacheSupport
-
addListener
public void addListener(@Nonnull com.atlassian.cache.CachedReferenceListener<V> listener, boolean includeValues) - Specified by:
addListenerin interfacecom.atlassian.cache.CachedReference<V>
-
removeListener
- Specified by:
removeListenerin interfacecom.atlassian.cache.CachedReference<V>
-