PDA

View Full Version : AOP Cache


pietercoucke
Sep 22nd, 2004, 09:50 AM
I've written an AOP interceptor (http://www.onthoo.com/blog/programming/2004/09/spring-aop-cache.html) which allows you to specify which methods to cache for Spring beans.
Different cache providers are available: Memory HashMap, EHCache, OSCache(which is clusterable) and SwarmCache.

See this XML file (http://www.onthoo.com/blog/programming/attachments/SpringAOPCache/sample.xml) for a sample configuration. More info is available in the javadocs.

I've used this code already in two projects, but not all implementations of the cache (SwarmCache) are well tested. The code is written in the org.springframework.aop.interceptor.cache package and may be copied/used for free.

Have fun and let me know if this is of any use to you. Comments are welcome too!

Eclipse project and source code download (http://www.onthoo.com/blog/programming/attachments/SpringAOPCache/project.zip)

Pieter Coucke
Onthoo.com (http://www.onthoo.com)