Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,12 +37,12 @@ public class CachingConfigurerSupport implements CachingConfigurer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public KeyGenerator keyGenerator() {
|
||||
public CacheResolver cacheResolver() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheResolver cacheResolver() {
|
||||
public KeyGenerator keyGenerator() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -110,21 +110,21 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
||||
*/
|
||||
private static void parseCacheResolution(Element element, BeanDefinition def, boolean setBoth) {
|
||||
String name = element.getAttribute("cache-resolver");
|
||||
if (StringUtils.hasText(name)) {
|
||||
boolean hasText = StringUtils.hasText(name);
|
||||
if (hasText) {
|
||||
def.getPropertyValues().add("cacheResolver", new RuntimeBeanReference(name.trim()));
|
||||
}
|
||||
if (!StringUtils.hasText(name) || setBoth) {
|
||||
if (!hasText || setBoth) {
|
||||
def.getPropertyValues().add("cacheManager",
|
||||
new RuntimeBeanReference(CacheNamespaceHandler.extractCacheManager(element)));
|
||||
}
|
||||
}
|
||||
|
||||
private static BeanDefinition parseErrorHandler(Element element, BeanDefinition def) {
|
||||
private static void parseErrorHandler(Element element, BeanDefinition def) {
|
||||
String name = element.getAttribute("error-handler");
|
||||
if (StringUtils.hasText(name)) {
|
||||
def.getPropertyValues().add("errorHandler", new RuntimeBeanReference(name.trim()));
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,12 +173,12 @@ class AnnotationDrivenCacheBeanDefinitionParser implements BeanDefinitionParser
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a
|
||||
* Registers a cache aspect.
|
||||
* <pre class="code">
|
||||
* <bean id="cacheAspect" class="org.springframework.cache.aspectj.AnnotationCacheAspect" factory-method="aspectOf">
|
||||
* <property name="cacheManager" ref="cacheManager"/>
|
||||
* <property name="keyGenerator" ref="keyGenerator"/>
|
||||
* </bean>
|
||||
* <bean id="cacheAspect" class="org.springframework.cache.aspectj.AnnotationCacheAspect" factory-method="aspectOf">
|
||||
* <property name="cacheManager" ref="cacheManager"/>
|
||||
* <property name="keyGenerator" ref="keyGenerator"/>
|
||||
* </bean>
|
||||
* </pre>
|
||||
*/
|
||||
private static void registerCacheAspect(Element element, ParserContext parserContext) {
|
||||
|
||||
@@ -207,8 +207,7 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||
}
|
||||
catch (NoUniqueBeanDefinitionException ex) {
|
||||
throw new IllegalStateException("No CacheResolver specified, and no unique bean of type " +
|
||||
"CacheManager found. Mark one as primary (or give it the name 'cacheManager') or " +
|
||||
"declare a specific CacheManager to use, that serves as the default one.");
|
||||
"CacheManager found. Mark one as primary or declare a specific CacheManager to use.");
|
||||
}
|
||||
catch (NoSuchBeanDefinitionException ex) {
|
||||
throw new IllegalStateException("No CacheResolver specified, and no bean of type CacheManager found. " +
|
||||
@@ -651,6 +650,9 @@ public abstract class CacheAspectSupport extends AbstractCacheInvoker
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A {@link CacheOperationInvocationContext} context for a {@link CacheOperation}.
|
||||
*/
|
||||
protected class CacheOperationContext implements CacheOperationInvocationContext<CacheOperation> {
|
||||
|
||||
private final CacheOperationMetadata metadata;
|
||||
|
||||
Reference in New Issue
Block a user