public class KeyGeneratorAdapter extends java.lang.Object implements KeyGenerator
KeyGenerator
implementation that delegates to a standard
JSR-107 javax.cache.annotation.CacheKeyGenerator
.
Used internally to invoke user-based JSR-107 cache key generators.
Modifier and Type | Field and Description |
---|---|
private JCacheOperationSource |
cacheOperationSource |
private CacheKeyGenerator |
target |
Constructor and Description |
---|
KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource,
CacheKeyGenerator target) |
Modifier and Type | Method and Description |
---|---|
private <any> |
createCacheKeyInvocationContext(java.lang.Object target,
JCacheOperation<?> operation,
java.lang.Object[] params) |
java.lang.Object |
generate(java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object... params)
Generate a key for the given method and its parameters.
|
protected CacheKeyGenerator |
getTarget()
Return the underlying
CacheKeyGenerator that this instance is using. |
private final JCacheOperationSource cacheOperationSource
private final CacheKeyGenerator target
public KeyGeneratorAdapter(JCacheOperationSource cacheOperationSource, CacheKeyGenerator target)
protected CacheKeyGenerator getTarget()
CacheKeyGenerator
that this instance is using.public java.lang.Object generate(java.lang.Object target, java.lang.reflect.Method method, java.lang.Object... params)
KeyGenerator
generate
in interface KeyGenerator
target
- the target instancemethod
- the method being calledparams
- the method parameters (with any var-args expanded)private <any> createCacheKeyInvocationContext(java.lang.Object target, JCacheOperation<?> operation, java.lang.Object[] params)