lexius
May 13th, 2006, 12:21 PM
It not working fo me.
my code:
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFa ctoryBean">
<property name="configLocation">
<value>classpath:ehcache.xml</value>
</property>
</bean>
<bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFa cade">
<property name="cacheManager" ref="cacheManager"/>
</bean>
<bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCach ingAttributeSource" />
<bean id="cachingInterceptor"
class="org.springmodules.cache.interceptor.caching.Metada taCachingInterceptor">
<property name="cacheProviderFacade" ref="cacheProviderFacade" />
<property name="cachingAttributeSource" ref="cachingAttributeSource" />
<property name="cacheKeyGenerator" ref="cacheKeyGenerator" />
<!--property name="cachingListeners">
<list>
<ref bean="cachingListener" />
</list>
</property-->
<property name="cachingModels">
<props>
<prop key="methodCaching">cacheName=methodCache</prop>
</props>
</property>
</bean>
<bean id="cachingAttributeSourceAdvisor"
class="org.springmodules.cache.interceptor.caching.Cachin gAttributeSourceAdvisor">
<constructor-arg ref="cachingInterceptor" />
</bean>
<bean id="flushingAttributeSource"
class="org.springmodules.cache.annotations.AnnotationFlus hingAttributeSource">
</bean>
<bean id="flushingInterceptor"
class="org.springmodules.cache.interceptor.flush.Metadata FlushingInterceptor">
<property name="cacheProviderFacade" ref="cacheProviderFacade" />
<property name="flushingAttributeSource" ref="flushingAttributeSource" />
<property name="flushingModels">
<props>
<prop key="methodFlushing">cacheNames=methodCache</prop>
</props>
</property>
</bean>
<bean id="flushingAttributeSourceAdvisor"
class="org.springmodules.cache.interceptor.flush.Flushing AttributeSourceAdvisor">
<constructor-arg ref="flushingInterceptor" />
</bean>
<bean id="cacheKeyGenerator" class="org.springmodules.cache.key.HashCodeCacheKeyGenera tor" />
my code:
<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFa ctoryBean">
<property name="configLocation">
<value>classpath:ehcache.xml</value>
</property>
</bean>
<bean id="cacheProviderFacade" class="org.springmodules.cache.provider.ehcache.EhCacheFa cade">
<property name="cacheManager" ref="cacheManager"/>
</bean>
<bean id="cachingAttributeSource" class="org.springmodules.cache.annotations.AnnotationCach ingAttributeSource" />
<bean id="cachingInterceptor"
class="org.springmodules.cache.interceptor.caching.Metada taCachingInterceptor">
<property name="cacheProviderFacade" ref="cacheProviderFacade" />
<property name="cachingAttributeSource" ref="cachingAttributeSource" />
<property name="cacheKeyGenerator" ref="cacheKeyGenerator" />
<!--property name="cachingListeners">
<list>
<ref bean="cachingListener" />
</list>
</property-->
<property name="cachingModels">
<props>
<prop key="methodCaching">cacheName=methodCache</prop>
</props>
</property>
</bean>
<bean id="cachingAttributeSourceAdvisor"
class="org.springmodules.cache.interceptor.caching.Cachin gAttributeSourceAdvisor">
<constructor-arg ref="cachingInterceptor" />
</bean>
<bean id="flushingAttributeSource"
class="org.springmodules.cache.annotations.AnnotationFlus hingAttributeSource">
</bean>
<bean id="flushingInterceptor"
class="org.springmodules.cache.interceptor.flush.Metadata FlushingInterceptor">
<property name="cacheProviderFacade" ref="cacheProviderFacade" />
<property name="flushingAttributeSource" ref="flushingAttributeSource" />
<property name="flushingModels">
<props>
<prop key="methodFlushing">cacheNames=methodCache</prop>
</props>
</property>
</bean>
<bean id="flushingAttributeSourceAdvisor"
class="org.springmodules.cache.interceptor.flush.Flushing AttributeSourceAdvisor">
<constructor-arg ref="flushingInterceptor" />
</bean>
<bean id="cacheKeyGenerator" class="org.springmodules.cache.key.HashCodeCacheKeyGenera tor" />