Monday, June 11, 2007

AOP Cache using Spring

Spring Discuss

AOP Cache

I've written an AOP interceptor (latest version: 2.4.1) 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.

Available implementations of CacheInterceptor are:

  • MemoryCacheInterceptor: a simple in-memory cache that's not meant for production
  • EHCacheInterceptor: uses EHCache from Hibernate and should be configured in ehcache.xml as described in the EHCache documentation.
  • SwarmCacheInterceptor: a clusterable cache implementation
  • OSCacheInterceptor: uses OSCache from OpenSymphony and is the one used in this example