Package org.cache2k.config
Interface CacheWrapper
-
public interface CacheWrapper
Wraps a cache in order to add functionality like tracing. The cache wrapper is called after a cache is build and may wrap a cache instance. The {@link org.cache2k.Cache2kBuilder@#build} andCacheManager.getCache(String)
will return the wrapped cache instead of the original. Depending on the configuration the wrapper may also decide to just return the original cache instance.The configuration allows specifying two different wrappers. One for tracing
Cache2kConfig.setTraceCacheWrapper(CacheWrapper)
and one for general useCache2kConfig.setCacheWrapper(CacheWrapper)
. The wrapping is applied in that order, with tracing first.To wrap a Cache the base classes
AbstractCache
orForwardingCache
are available.- Author:
- Jens Wilke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <K,V>
Cache<K,V>wrap(CacheBuildContext<K,V> context, Cache<K,V> cache)
-
-
-
Method Detail
-
wrap
<K,V> Cache<K,V> wrap(CacheBuildContext<K,V> context, Cache<K,V> cache)
-
-