public interface CacheExtension
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 BlockingCache
for an example of how to do
this.
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.Modifier and Type | Method and Description |
---|---|
CacheExtension |
clone(Ehcache cache)
Creates a clone of this extension.
|
void |
dispose()
Providers may be doing all sorts of exotic things and need to be able to clean up on
dispose.
|
Status |
getStatus() |
void |
init()
Notifies providers to initialise themselves.
|
void init()
CacheException
void dispose() throws CacheException
CacheException
CacheExtension clone(Ehcache cache) throws CloneNotSupportedException
cache
- the cache extendedCloneNotSupportedException
- if the extension could not be cloned.Status getStatus()
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.