public class DefaultStatisticsAwareCache extends Object implements org.springframework.beans.factory.InitializingBean, StatisticsAwareCache
Default caching class for dealing with Caches managed by a CacheManager.
| Modifier and Type | Field and Description |
|---|---|
static List<String> |
CACHES |
ALL_DEFINITION_CACHES, EDORAS_GEAR_ANY_WORK_OBJECT_DEFINITIONS_BY_EXTERNAL_ID_CACHE_NAME, EDORAS_GEAR_ANY_WORK_OBJECT_DEFINITIONS_BY_ID_CACHE_NAME, EDORAS_GEAR_CONTENT_METADATA_BY_CONTENT_REFERENCE_ID, EDORAS_GEAR_CONTENT_REFERENCES_BY_CONTENT_SOURCE_ID, EDORAS_GEAR_CONTENT_VERSIONS_BY_CONTENT_REFERENCE_ID, EDORAS_GEAR_FORM_DEFINITIONS_BY_KEY_CACHE_NAME, EDORAS_GEAR_GLOBAL_ID_BY_WORK_OBJECT_ID_CACHE_NAME, EDORAS_GEAR_WORK_OBJECT_ID_BY_GLOBAL_ID_CACHE_NAME, EDORAS_ONE_CONVERTED_DOCUMENTS_CACHE_NAME, EDORAS_ONE_DEFINITION_ID_BY_MODEL_ID_CACHE_NAME, EDORAS_ONE_LANGUAGES_BY_LOCALE_CACHE_NAME, EDORAS_ONE_PREVIEWED_DOCUMENTS_CACHE_NAME, EDORAS_ONE_SYSTEM_GROUPS_BY_TENANT_ID_CACHE_NAME, EDORAS_ONE_TENANT_ID_BY_NAME_CACHE_NAME, EDORAS_ONE_TENANT_NAME_BY_ID_CACHE_NAME, EDORAS_VIS_PALETTE_CACHE_NAME, EDORAS_VIS_UTIL_CACHE_NAME| Constructor and Description |
|---|
DefaultStatisticsAwareCache(org.springframework.cache.CacheManager cacheManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
clear(String... cacheNames)
Clears all values from the specified cache by name.
|
void |
evict(String cacheName,
Object key)
Evicts the value in the specified cache by name and key.
|
<T> T |
get(String cacheName,
Object key,
Class<T> valueClass)
Gets the value from the specified cache by name and key.
|
org.springframework.cache.Cache |
getCache(String cacheName)
Return the cache instance by the given cache name.
|
List<CacheStatistics> |
getCacheStatistics()
Returns the
CacheStatistics of all currently used cache instances. |
void |
put(String cacheName,
Object key,
Object value)
Saves the value in the specified cache by name and key.
|
public DefaultStatisticsAwareCache(org.springframework.cache.CacheManager cacheManager)
public List<CacheStatistics> getCacheStatistics()
StatisticsAwareCacheReturns the CacheStatistics of all currently used cache instances. If the configured Cache does not implement the CacheStatistics interface,
the statistics are not returned for this instance.
getCacheStatistics in interface StatisticsAwareCacheCacheStatistics of all currently used cache instances.public org.springframework.cache.Cache getCache(String cacheName)
StatisticsAwareCacheReturn the cache instance by the given cache name.
getCache in interface StatisticsAwareCachecacheName - the cache name for which the cache is returnedpublic <T> T get(String cacheName, Object key, Class<T> valueClass)
StatisticsAwareCacheGets the value from the specified cache by name and key. The return value is casted to the specified value class.
get in interface StatisticsAwareCacheT - the class of the returned valuecacheName - the name of the cache to get the value fromkey - the key of the valuevalueClass - the class of the returned valuepublic void put(String cacheName, Object key, Object value)
StatisticsAwareCacheSaves the value in the specified cache by name and key.
put in interface StatisticsAwareCachecacheName - the name of the cache to save the value tokey - the key of the valuevalue - the value to be saved. Depending on the underlying cache implementation, the value can be null.public void evict(String cacheName, Object key)
StatisticsAwareCacheEvicts the value in the specified cache by name and key.
evict in interface StatisticsAwareCachecacheName - the name of the cache to evict the value fromkey - the key of the valuepublic void clear(String... cacheNames)
StatisticsAwareCacheClears all values from the specified cache by name.
clear in interface StatisticsAwareCachecacheNames - the names of the caches to evict the value fromCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.