applicationContext-cache.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans
  3. xmlns="http://www.springframework.org/schema/beans"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:jdbc="http://www.springframework.org/schema/jdbc"
  7. xmlns:jee="http://www.springframework.org/schema/jee"
  8. xmlns:tx="http://www.springframework.org/schema/tx"
  9. xmlns:jpa="http://www.springframework.org/schema/data/jpa"
  10. xmlns:cache="http://www.springframework.org/schema/cache"
  11. xmlns:aop="http://www.springframework.org/schema/aop"
  12. xsi:schemaLocation="
  13. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
  14. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
  15. http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.0.xsd
  16. http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd
  17. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
  18. http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
  19. http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.0.xsd
  20. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"
  21. >
  22. <context:annotation-config/>
  23. <cache:annotation-driven cache-manager="cacheManager"/>
  24. <!-- spring cache -->
  25. <!-- <bean id="cacheManager" class="org.springframework.cache.support.SimpleCacheManager">
  26. <property name="caches">
  27. <set>
  28. <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
  29. <property name="name" value="default"/>
  30. </bean>
  31. <bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean">
  32. <property name="name" value="productType"/>
  33. </bean>
  34. </set>
  35. </property>
  36. </bean> -->
  37. <!-- eh-cache -->
  38. <bean id="cacheManagerFactory" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
  39. <property name="configLocation" value="classpath:ehcache.xml"/>
  40. </bean>
  41. <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
  42. <property name="cacheManager" ref="cacheManagerFactory"/>
  43. </bean>
  44. </beans>