Clear expression caches on context shutdown
Issue: SPR-12691
This commit is contained in:
@@ -288,6 +288,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||
*/
|
||||
protected void clearMetadataCache() {
|
||||
this.metadataCache.clear();
|
||||
this.evaluator.clear();
|
||||
}
|
||||
|
||||
protected Object execute(CacheOperationInvoker invoker, Object target, Method method, Object[] args) {
|
||||
|
||||
@@ -123,6 +123,16 @@ class ExpressionEvaluator extends CachedExpressionEvaluator {
|
||||
return getExpression(this.unlessCache, methodKey, unlessExpression).getValue(evalContext, boolean.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all caches.
|
||||
*/
|
||||
void clear() {
|
||||
this.keyCache.clear();
|
||||
this.conditionCache.clear();
|
||||
this.unlessCache.clear();
|
||||
this.targetMethodCache.clear();
|
||||
}
|
||||
|
||||
private Method getTargetMethod(Class<?> targetClass, Method method) {
|
||||
AnnotatedElementKey methodKey = new AnnotatedElementKey(method, targetClass);
|
||||
Method targetMethod = this.targetMethodCache.get(methodKey);
|
||||
|
||||
Reference in New Issue
Block a user