public class AppStatusCacheManager extends Object implements org.springframework.cache.CacheManager
When the cache returns a value and AppStatus is used with useThreadLocal and a service call is active (IServiceMonitor#beginCall was called), the current service call is flagged as "cacheHit".
Usage : simply add AppStatusCacheManager as your cacheManager and reference your previous spring cache manager in your Spring config files.
With EhCacheManager :
<bean id="cacheManager" class="net.sf.appstatus.support.spring.cache.AppStatusCacheManager" p:cache-manager-ref="ehCacheCacheManager"/> <bean id="ehCacheCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache"/> <!-- Ehcache library setup --> <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config-location="ehcache.xml"/>
Constructor and Description |
---|
AppStatusCacheManager() |
Modifier and Type | Method and Description |
---|---|
org.springframework.cache.Cache |
getCache(String name) |
Collection<String> |
getCacheNames() |
void |
setCacheManager(org.springframework.cache.CacheManager cacheManager) |
public org.springframework.cache.Cache getCache(String name)
getCache
in interface org.springframework.cache.CacheManager
public Collection<String> getCacheNames()
getCacheNames
in interface org.springframework.cache.CacheManager
public void setCacheManager(org.springframework.cache.CacheManager cacheManager)
Copyright © 2010–2016. All rights reserved.