PDA

View Full Version : Caching in SpringModules 0.3


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" />

Costin Leau
May 19th, 2006, 04:08 PM
What exactly did not work? Can you turn on logging and post the relevant messages?

lexius
May 19th, 2006, 04:31 PM
Tha cache is empty. I don'i know which messages I can post.

Costin Leau
May 19th, 2006, 04:42 PM
For example that one that are executed when the method is intercepted and that then take into account populating the cache.

lexius
May 19th, 2006, 04:53 PM
My log is clear. Nothing was loged in debug level from springmodules.

Costin Leau
May 19th, 2006, 05:04 PM
I think you have some configuration problem - take a look at the source code from cache module - it does contain logging. Either your logging is not turned on or for some reason you don't actually use the cache module (and thus no logging appears).

awardsure
Jun 2nd, 2006, 12:48 AM
Hi, the class org.springframework.cache.ehcache.EhCacheManagerFa ctoryBean does not exist in springmodules-cache.jar when I dowanloaded from https://springmodules.dev.java.net/

how can I get the spring modules v0.3 completely, thanks.

Costin Leau
Jun 2nd, 2006, 02:14 AM
In 0.3 the EhCacheManagerFactoryBean has been refactored into org.springmodules.cache.provider.ehcache.EhCacheFa cade.

lexius
Jun 10th, 2006, 08:07 AM
This is my log:

org.springmodules.cache.interceptor.caching.Metada taCachingInterceptor
Unable to perform caching. No model is associated to the intercepted method <handleRequest>

what is it?

lexius
Jun 10th, 2006, 08:09 AM
And my config:

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFa ctoryBean">
<property name="configLocation">
<value>classpath:ehcache.xml</value>
</property>
</bean>

<bean class="org.springframework.aop.framework.autoproxy.BeanNa meAutoProxyCreator">
<property name="beanNames">
<list>
<idref bean="adminUserStatController"/>
</list>
</property>
<property name="interceptorNames">
<list>
<value>cachingInterceptor</value>
<value>flushingInterceptor</value>
</list>
</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="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>