我正在使用ehcache-spring-annotations缓存我的应用程序数据。为此,我有以下配置:
<bean id="ehCacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
<property name="configLocation" value="classpath:ehcache.xml"/>
</bean>
<ehcache:annotation-driven cache-manager="ehCacheManager" /> 我想从配置好的bean‘ehCacheManager’.中获取'net.sf.ehcache.CacheManager‘的引用这样,我就可以使用“CacheManager”直接在缓存中手动执行put或remove操作。
从'net.sf.ehcache.CacheManager‘中获取'org.springframework.cache.ehcache.EhCacheManagerFactoryBean'?参考的任何方法
发布于 2013-10-15 10:27:33
我使用下面的代码在我的类中获取缓存管理器引用:
@Resource
private CacheManager ehCacheManager;https://stackoverflow.com/questions/19109778
复制相似问题