public class MgnlObjectsAwareCacheKeyGenerator extends Object implements javax.cache.annotation.CacheKeyGenerator
CacheKeyGenerator that maps every Node argument to its path, which makes it Serializable
It also recognizes some other magnolia objects, which can trivially be serialized but are not Serializable themselves.
Currently these are info.magnolia.module.site.Site and info.magnolia.dam.api.Item. These are not magnolia core classes by the way.
This class can be used as an argument for CacheResult.cacheKeyGenerator() for methods which have these kind of JCR or other magnolia objects as arguments.| Constructor and Description |
|---|
MgnlObjectsAwareCacheKeyGenerator() |
| Modifier and Type | Method and Description |
|---|---|
javax.cache.annotation.GeneratedCacheKey |
generateCacheKey(javax.cache.annotation.CacheKeyInvocationContext<? extends Annotation> cacheKeyInvocationContext) |
static <T> void |
register(Class<T> clazz,
Function<T,Serializable> function) |
protected static void |
register(String clazz,
String method) |
public static <T> void register(Class<T> clazz, Function<T,Serializable> function)
public javax.cache.annotation.GeneratedCacheKey generateCacheKey(javax.cache.annotation.CacheKeyInvocationContext<? extends Annotation> cacheKeyInvocationContext)
generateCacheKey in interface javax.cache.annotation.CacheKeyGeneratorCopyright © 2016–2022. All rights reserved.