public DefaultCacheKeyInvocationContext(AbstractJCacheKeyOperation<A> operation, Object target, Object[] args) { super(operation, target, args); this.keyParameters = operation.getKeyParameters(args); if (operation instanceof CachePutOperation) { this.valueParameter = ((CachePutOperation) operation).getValueParameter(args); } else { this.valueParameter = null; } }
/** * Create a new instance. * @param methodDetails the {@link CacheMethodDetails} related to the cached method * @param cacheResolver the cache resolver to resolve regular caches * @param keyGenerator the key generator to compute cache keys */ protected AbstractJCacheKeyOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver, KeyGenerator keyGenerator) { super(methodDetails, cacheResolver); this.keyGenerator = keyGenerator; this.keyParameterDetails = initializeKeyParameterDetails(this.allParameterDetails); }
private void assertDefaults(AbstractJCacheKeyOperation<?> operation) { assertEquals(defaultCacheResolver, operation.getCacheResolver()); assertEquals(KeyGeneratorAdapter.class, operation.getKeyGenerator().getClass()); assertEquals(defaultKeyGenerator, ((KeyGeneratorAdapter) operation.getKeyGenerator()).getTarget()); }
/** * Generate a key for the specified invocation. * @param context the context of the invocation * @return the key to use */ protected Object generateKey(CacheOperationInvocationContext<O> context) { KeyGenerator keyGenerator = context.getOperation().getKeyGenerator(); Object key = keyGenerator.generate(context.getTarget(), context.getMethod(), context.getArgs()); if (logger.isTraceEnabled()) { logger.trace("Computed cache key " + key + " for operation " + context.getOperation()); } return key; }
/** * Generate a key for the specified invocation. * @param context the context of the invocation * @return the key to use */ protected Object generateKey(CacheOperationInvocationContext<O> context) { KeyGenerator keyGenerator = context.getOperation().getKeyGenerator(); Object key = keyGenerator.generate(context.getTarget(), context.getMethod(), context.getArgs()); if (logger.isTraceEnabled()) { logger.trace("Computed cache key " + key + " for operation " + context.getOperation()); } return key; }
/** * Generate a key for the specified invocation. * @param context the context of the invocation * @return the key to use */ protected Object generateKey(CacheOperationInvocationContext<O> context) { KeyGenerator keyGenerator = context.getOperation().getKeyGenerator(); Object key = keyGenerator.generate(context.getTarget(), context.getMethod(), context.getArgs()); if (logger.isTraceEnabled()) { logger.trace("Computed cache key " + key + " for operation " + context.getOperation()); } return key; }
public DefaultCacheKeyInvocationContext(AbstractJCacheKeyOperation<A> operation, Object target, Object[] args) { super(operation, target, args); this.keyParameters = operation.getKeyParameters(args); if (operation instanceof CachePutOperation) { this.valueParameter = ((CachePutOperation) operation).getValueParameter(args); } else { this.valueParameter = null; } }
/** * Create a new instance. * @param methodDetails the {@link CacheMethodDetails} related to the cached method * @param cacheResolver the cache resolver to resolve regular caches * @param keyGenerator the key generator to compute cache keys */ protected AbstractJCacheKeyOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver, KeyGenerator keyGenerator) { super(methodDetails, cacheResolver); this.keyGenerator = keyGenerator; this.keyParameterDetails = initializeKeyParameterDetails(this.allParameterDetails); }
public DefaultCacheKeyInvocationContext(AbstractJCacheKeyOperation<A> operation, Object target, Object[] args) { super(operation, target, args); this.keyParameters = operation.getKeyParameters(args); if (operation instanceof CachePutOperation) { this.valueParameter = ((CachePutOperation) operation).getValueParameter(args); } else { this.valueParameter = null; } }
/** * Create a new instance. * @param methodDetails the {@link CacheMethodDetails} related to the cached method * @param cacheResolver the cache resolver to resolve regular caches * @param keyGenerator the key generator to compute cache keys */ protected AbstractJCacheKeyOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver, KeyGenerator keyGenerator) { super(methodDetails, cacheResolver); this.keyGenerator = keyGenerator; this.keyParameterDetails = initializeKeyParameterDetails(this.allParameterDetails); }