@ParametersAreNonnullByDefault public abstract class ManagedCacheSupport extends Object implements ManagedCache
ManagedCache methods for caches and cached references that are
backed by IMaps.| Modifier and Type | Field and Description |
|---|---|
protected HazelcastCacheManager |
cacheManager |
| Constructor and Description |
|---|
ManagedCacheSupport(String name,
HazelcastCacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
Long |
currentExpireAfterAccessMillis() |
Long |
currentExpireAfterWriteMillis() |
Integer |
currentMaxEntries() |
protected abstract String |
getHazelcastMapName() |
String |
getName()
The name of the cache, uniquely identifies this cache.
|
SortedMap<CacheStatisticsKey,Supplier<Long>> |
getStatistics()
Get usage statistics for the cache.
|
boolean |
isFlushable()
Returns true if this cache can be safely flushed any time.
|
boolean |
isLocal() |
boolean |
isReplicateAsynchronously() |
boolean |
isReplicateViaCopy() |
boolean |
isStatisticsEnabled() |
void |
setStatistics(boolean enabled)
Changes the state of statistics gathering.
|
boolean |
updateExpireAfterAccess(long expireAfter,
TimeUnit timeUnit)
Attempts to update the hint regarding how long entries that should be held in the cache, after last access.
|
boolean |
updateExpireAfterWrite(long expireAfter,
TimeUnit timeUnit)
Attempts to update the hint regarding how long entries that should be held in the cache, after last write.
|
boolean |
updateMaxEntries(int newValue)
Attempts to update the hint regarding the maximum number of entries that should be cached at any time.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, getCacheCollectorprotected final HazelcastCacheManager cacheManager
public ManagedCacheSupport(String name, HazelcastCacheManager cacheManager)
@Nullable public Long currentExpireAfterAccessMillis()
currentExpireAfterAccessMillis in interface ManagedCache@Nullable public Long currentExpireAfterWriteMillis()
currentExpireAfterWriteMillis in interface ManagedCache@Nullable public Integer currentMaxEntries()
currentMaxEntries in interface ManagedCachepublic boolean isReplicateViaCopy()
isReplicateViaCopy in interface ManagedCache@Nonnull public String getName()
ManagedCachegetName in interface ManagedCachepublic 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 isLocal()
isLocal in interface ManagedCachepublic boolean isReplicateAsynchronously()
isReplicateAsynchronously in interface ManagedCachepublic boolean updateExpireAfterAccess(long expireAfter,
TimeUnit timeUnit)
ManagedCacheupdateExpireAfterAccess in interface ManagedCacheexpireAfter - Time to retain entries for since their last access.timeUnit - The TimeUnit for the timepublic boolean updateExpireAfterWrite(long expireAfter,
TimeUnit timeUnit)
ManagedCacheupdateExpireAfterWrite in interface ManagedCacheexpireAfter - Time to retain entries for since their last write.timeUnit - The TimeUnit for the timepublic boolean updateMaxEntries(int newValue)
ManagedCacheupdateMaxEntries in interface ManagedCachenewValue - the new hint value@Nonnull public SortedMap<CacheStatisticsKey,Supplier<Long>> getStatistics()
ManagedCache
The statistics are sorted by the cache statistics key labels. Providing
statistics is an optional feature and no assumptions should be made by the caller about which (if any) statistics
will be returned.
getStatistics in interface ManagedCachepublic boolean isStatisticsEnabled()
isStatisticsEnabled in interface ManagedCachepublic void setStatistics(boolean enabled)
ManagedCachesetStatistics in interface ManagedCacheenabled - The stats collection is enabled if true - disabled otherwise.Copyright © 2018 Atlassian. All rights reserved.