public class StatisticsAwareCacheWrapper extends Object implements org.springframework.cache.Cache, com.edorasware.commons.core.cache.CacheStatistics
This class wraps a Cache
and holds the statistical data to satisfy the CacheStatistics
interface.
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static StatisticsAwareCacheWrapper |
create(org.springframework.cache.Cache wrappedCache)
Creates a new instance based on the given
Cache . |
void |
evict(Object key) |
org.springframework.cache.Cache.ValueWrapper |
get(Object key) |
<T> T |
get(Object key,
Callable<T> valueLoader) |
<T> T |
get(Object key,
Class<T> type) |
long |
getCacheClearedCount() |
long |
getCurrentEntries() |
double |
getEffectiveness() |
long |
getEntriesEvicted() |
long |
getEntriesHit() |
long |
getEntriesMissed() |
String |
getName() |
Object |
getNativeCache() |
void |
put(Object key,
Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(Object key,
Object value) |
public static StatisticsAwareCacheWrapper create(org.springframework.cache.Cache wrappedCache)
Creates a new instance based on the given Cache
.
wrappedCache
- the cache for which to add statistical datapublic double getEffectiveness()
getEffectiveness
in interface com.edorasware.commons.core.cache.CacheStatistics
public long getCurrentEntries()
getCurrentEntries
in interface com.edorasware.commons.core.cache.CacheStatistics
public long getEntriesHit()
getEntriesHit
in interface com.edorasware.commons.core.cache.CacheStatistics
public long getEntriesMissed()
getEntriesMissed
in interface com.edorasware.commons.core.cache.CacheStatistics
public long getEntriesEvicted()
getEntriesEvicted
in interface com.edorasware.commons.core.cache.CacheStatistics
public long getCacheClearedCount()
getCacheClearedCount
in interface com.edorasware.commons.core.cache.CacheStatistics
public String getName()
getName
in interface com.edorasware.commons.core.cache.CacheStatistics
getName
in interface org.springframework.cache.Cache
public Object getNativeCache()
getNativeCache
in interface org.springframework.cache.Cache
public org.springframework.cache.Cache.ValueWrapper get(Object key)
get
in interface org.springframework.cache.Cache
public <T> T get(Object key, Class<T> type)
get
in interface org.springframework.cache.Cache
public <T> T get(Object key, Callable<T> valueLoader)
get
in interface org.springframework.cache.Cache
public void put(Object key, Object value)
put
in interface org.springframework.cache.Cache
public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, Object value)
putIfAbsent
in interface org.springframework.cache.Cache
public void evict(Object key)
evict
in interface org.springframework.cache.Cache
public void clear()
clear
in interface org.springframework.cache.Cache
Copyright © 2010 - 2018 edorasware ag. All Rights Reserved.