This is a general purpose mechanism to allow generic extensions to a Cache.
CacheExtensions are tied into the Cache lifecycle. For that reason this interface has the lifecycle methods.
CacheExtensions are created using the CacheExtensionFactory which has a
createCacheCacheExtension()
method which takes as a parameter a Cache and properties. It can thus call back into any public method on Cache, including, of course, the load methods.
CacheExtensions are suitable for timing services, where you want to create a timer to perform cache operations. The other way of adding Cache behaviour is to decorate a cache. See {@link net.sf.ehcache.constructs.blocking.BlockingCache} for an example of how to dothis.
Because a CacheExtension holds a reference to a Cache, the CacheExtension can do things such as registering a CacheEventListener or even a CacheManagerEventListener, all from within a CacheExtension, creating more opportunities for customisation.
@author
Greg Luck
@version $Id: CacheExtension.java 791 2008-10-06 09:01:47Z gregluck $