2010-05-20 108 views
3

Spring模塊有一個@Cacheable註釋:緩存與Spring框架

org.springmodules.cache.annotations.Cacheable 

既然彈簧組件已過時,什麼是緩存的建議?仍然可以使用ehCache?

回答

2

彈簧模塊的用戶已經被遺漏在肢體上。我沒有直接替換我知道的@Cacheable。儘管如此,Spring的確對EhCache有一定的支持,其形式爲EhCacheFactoryBean和相關類(參見javadoc)。這爲創建和管理EhCache實例提供了一種非常簡單的方法,但是您必須手動使用它。

+0

http://code.google.com/p/ehcache-spring-annotations/是針對spring-module緩存註釋的ehcache特定替換。 – Eric 2011-04-12 20:19:43

0

現在這是在春天上下文中找到。我沒有檢查它有多遠,但它在4.1.4.RELEASE中。

\ org \ springframework \ cache \ annotation \