Posts Tagged AOP

Caching Techniques using spring AOP

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

<bean id=”methodCachingAdvice”>
<property name=”cache”>
<ref local=”methodCache” />
</property>
</bean>
<!– Begin Cache Configuration –>
<bean id=”cacheManager”>
<property name=”configLocation”>
<value>classpath:ehcache.xml</value>
</property>
<property name=”shared”>
<value>true</value>
</property>
</bean>
<bean id=”methodCache”>
<property name=”cacheManager”>
<ref local=”cacheManager” />
</property>
<property name=”cacheName”>
<value>cache.REFERENCE_DATA_CACHE</value>
</property>
</bean>

Advertisements

Comments (2)