日期:2014-05-17 浏览次数:24480 次
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd ">
<bean id="cacheManager" class="org.springmodules.cache.provider.oscache.OsCacheManagerFactoryBean">
<property name="configLocation" value="classpath:oscache.properties" />
</bean>
<bean id="oscacheFacade" class="org.springmodules.cache.provider.oscache.OsCacheFacade">
<property name="cacheManager" ref="cacheManager" />
</bean>
<bean id="cachingInterceptor001" class="org.springmodules.cache.interceptor.caching.MethodMapCachingInterceptor">
<property name="cacheProviderFacade" ref="oscacheFacade"/>
<property name="cachingModels">
<props>
<prop key="com.qh.dao.StudentDao.selectStudent">groups=aa</prop>
</props>
</property>
</bean>
<bean id="flushInterceptor001" class="org.springmodules.cache.interceptor.flush.MethodMapFlushingInterceptor">
<property name="cacheProviderFacade" ref="oscacheFacade"/>
<property name="flushingModels">
<props>
<prop key="com.qh.dao.StudentDao.updateStudentById">groups=aa</prop>
</props>
</property>
</bean>
<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="beanNames">
<value>*Dao</value>
</property>
<property name="interceptorNames">
<list>
<value>cachingInterceptor001</value>
<value>flushInterceptor001</value>
</list>
</property>
</bean>
</beans>