public class HazelcastHybridCachedReference<V> extends ManagedHybridCacheSupport implements CachedReference<V>
ManagedCache and CachedReference that can be used when the
cached value does not implement Serializable but reference invalidation must work cluster-wide.cacheManager, name| Constructor and Description |
|---|
HazelcastHybridCachedReference(String name,
CacheFactory localFactory,
com.hazelcast.core.IMap<ReferenceKey,Long> versionMap,
Supplier<V> supplier,
HazelcastCacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(CachedReferenceListener<V> listener,
boolean includeValues)
Adds a
CachedReferenceListener |
void |
clear()
Clear the cache.
|
V |
get()
Get a value from the cache.
|
protected ManagedCache |
getLocalCache() |
boolean |
isFlushable()
Returns true if this cache can be safely flushed any time.
|
boolean |
isReplicateAsynchronously() |
void |
removeListener(CachedReferenceListener<V> listener)
Removes a
CachedReferenceListener |
void |
reset()
Resets (clears/invalidates) this reference.
|
boolean |
updateMaxEntries(int newValue)
Attempts to update the hint regarding the maximum number of entries that should be cached at any time.
|
currentExpireAfterAccessMillis, currentExpireAfterWriteMillis, currentMaxEntries, getName, getStatistics, isLocal, isReplicateViaCopy, isStatisticsEnabled, setStatistics, updateExpireAfterAccess, updateExpireAfterWriteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCacheCollectorpublic HazelcastHybridCachedReference(String name, CacheFactory localFactory, com.hazelcast.core.IMap<ReferenceKey,Long> versionMap, Supplier<V> supplier, HazelcastCacheManager cacheManager)
@Nonnull public V get()
CachedReferenceget in interface CachedReference<V>public boolean isFlushable()
ManagedCache
This method is used by CacheManager.flushCaches() to only flush caches that can be safely flushed. ManagedCache.clear() ignores this value.
isFlushable in interface ManagedCachepublic boolean isReplicateAsynchronously()
isReplicateAsynchronously in interface ManagedCachepublic void reset()
CachedReferencereset in interface CachedReference<V>protected ManagedCache getLocalCache()
getLocalCache in class ManagedHybridCacheSupportpublic void clear()
ManagedCacheclear in interface ManagedCachepublic boolean updateMaxEntries(int newValue)
ManagedCacheupdateMaxEntries in interface ManagedCacheupdateMaxEntries in class ManagedHybridCacheSupportnewValue - the new hint valuepublic void addListener(@Nonnull CachedReferenceListener<V> listener, boolean includeValues)
CachedReferenceCachedReferenceListeneraddListener in interface CachedReference<V>listener - the listenerincludeValues - if the events sent to this listener will include old/new value. This can be used in cases
when the cost of finding these values is big (network sync) but the listener is not interested in the concrete
values for events its getting. The support for this parameter is optional and implementation dependentpublic void removeListener(@Nonnull CachedReferenceListener<V> listener)
CachedReferenceCachedReferenceListenerremoveListener in interface CachedReference<V>listener - the listenerCopyright © 2018 Atlassian. All rights reserved.