Caching Techniques using spring AOP

<!– Implementation of Data Service & Caching Advice : –>
<!– Data Caching Advice –>
<aop:advisor id=”referenceCachingAdvisor” pointcut=”execution(* com.interface101.xml.impl.ReferenceDataImpl.getReferenceData(..))”
advice-ref=”methodCachingAdvice” />

<bean id=”methodCachingAdvice”>
<property name=”cache”>
<ref local=”methodCache” />
<!– Begin Cache Configuration –>
<bean id=”cacheManager”>
<property name=”configLocation”>
<property name=”shared”>
<bean id=”methodCache”>
<property name=”cacheManager”>
<ref local=”cacheManager” />
<property name=”cacheName”>



  1. Josh Lupotokin said

    We have implemented the Ehcache solution for caching within our product, we manage to inject the cache manager of Ehcache entirely using your code in our spring’s application context XML which worked great.

    Thank you for sharing the code.

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: