SPR-8082
SPR-7833
+ add support for CacheDefinitions declarations inside XML
+ more integration tests
This commit is contained in:
Costin Leau
2011-11-09 17:53:51 +00:00
parent e4c88553d8
commit dc88a7c8ba
20 changed files with 497 additions and 175 deletions

View File

@@ -30,6 +30,8 @@
<property name="caches">
<set>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
</set>
</property>
</bean>

View File

@@ -17,6 +17,8 @@
<property name="caches">
<set>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
</set>
</property>
</bean>

View File

@@ -20,6 +20,26 @@
<cache:cache-evict method="invalidate" cache="default"/>
<cache:cache-evict method="evict" key="#p0" cache="default"/>
</cache:definitions>
<cache:definitions cache="default">
<cache:cache-put method="update"/>
<cache:cache-put method="conditionalUpdate" condition="#arg.equals(3)"/>
</cache:definitions>
<cache:definitions method="mult*Cache">
<cache:cacheable cache="primary"/>
<cache:cacheable cache="secondary"/>
</cache:definitions>
<cache:definitions method="multiEvict">
<cache:cache-evict cache="primary"/>
<cache:cache-evict method="multiEvict" cache="secondary" key="#p0"/>
</cache:definitions>
<cache:definitions>
<cache:cacheable method="multiCacheAndEvict" cache="primary" key="#root.methodName"/>
<cache:cache-evict method="multiCacheAndEvict" cache="secondary"/>
<cache:cacheable method="multiConditionalCacheAndEvict" cache="primary" condition="#p0 == 3"/>
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
<cache:cache-put method="multiUpdate" cache="primary"/>
<cache:cache-put method="multiUpdate" cache="secondary"/>
</cache:definitions>
</cache:advice>
<cache:advice id="cacheAdviceClass" cache-manager="cacheManager" key-generator="keyGenerator">
@@ -35,6 +55,22 @@
<cache:cache-evict method="invalidate" cache="default"/>
<cache:cache-evict method="evict" key="#p0" cache="default"/>
</cache:definitions>
<cache:definitions cache="default">
<cache:cache-put method="update"/>
<cache:cache-put method="conditionalUpdate" condition="#arg.equals(3)"/>
</cache:definitions>
<cache:definitions>
<cache:cacheable method="multiCache" cache="primary"/>
<cache:cacheable method="multiCache" cache="secondary"/>
<cache:cache-evict method="multiEvict" cache="primary"/>
<cache:cache-evict method="multiEvict" cache="secondary" key="#p0"/>
<cache:cacheable method="multiCacheAndEvict" cache="primary" key="#root.methodName"/>
<cache:cache-evict method="multiCacheAndEvict" cache="secondary"/>
<cache:cacheable method="multiConditionalCacheAndEvict" cache="primary" condition="#p0 == 3"/>
<cache:cache-evict method="multiConditionalCacheAndEvict" cache="secondary"/>
<cache:cache-put method="multiUpdate" cache="primary"/>
<cache:cache-put method="multiUpdate" cache="secondary"/>
</cache:definitions>
</cache:advice>
<aop:config>
@@ -47,6 +83,8 @@
<property name="caches">
<set>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="default"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="primary"/>
<bean class="org.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean" p:name="secondary"/>
</set>
</property>
</bean>