Rename KeyGenerator#extract => #generate
This commit is contained in:
parent
06306f9149
commit
f9879b762b
|
|
@ -453,7 +453,7 @@ public abstract class CacheAspectSupport implements InitializingBean {
|
||||||
if (StringUtils.hasText(this.operation.getKey())) {
|
if (StringUtils.hasText(this.operation.getKey())) {
|
||||||
return evaluator.key(this.operation.getKey(), this.method, this.evalContext);
|
return evaluator.key(this.operation.getKey(), this.method, this.evalContext);
|
||||||
}
|
}
|
||||||
return keyGenerator.extract(this.target, this.method, this.args);
|
return keyGenerator.generate(this.target, this.method, this.args);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Collection<Cache> getCaches() {
|
protected Collection<Cache> getCaches() {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ public class DefaultKeyGenerator implements KeyGenerator {
|
||||||
public static final int NO_PARAM_KEY = 0;
|
public static final int NO_PARAM_KEY = 0;
|
||||||
public static final int NULL_PARAM_KEY = 53;
|
public static final int NULL_PARAM_KEY = 53;
|
||||||
|
|
||||||
public Object extract(Object target, Method method, Object... params) {
|
public Object generate(Object target, Method method, Object... params) {
|
||||||
if (params.length == 1) {
|
if (params.length == 1) {
|
||||||
return (params[0] == null ? NULL_PARAM_KEY : params[0]);
|
return (params[0] == null ? NULL_PARAM_KEY : params[0]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,15 @@ package org.springframework.cache.interceptor;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache 'key' extractor. Used for creating a key based on the given method
|
* Cache key generator. Used for creating a key based on the given method
|
||||||
* (used as context) and its parameters.
|
* (used as context) and its parameters.
|
||||||
*
|
*
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
|
* @author Chris Beams
|
||||||
* @since 3.1
|
* @since 3.1
|
||||||
*/
|
*/
|
||||||
public interface KeyGenerator {
|
public interface KeyGenerator {
|
||||||
|
|
||||||
Object extract(Object target, Method method, Object... params);
|
Object generate(Object target, Method method, Object... params);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue