Add default methods to CachingConfigurer

This commit adds default methods to CachingConfigurer and
JCacheConfigurer and removes the reference to their respective support
classes as they are now irrelevant.

Closes gh-27811
This commit is contained in:
Stephane Nicoll 2021-12-14 13:44:48 +01:00
parent c50a5096a0
commit 8422d9d22f
14 changed files with 59 additions and 53 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,8 +26,7 @@ import org.springframework.lang.Nullable;
* <p>To be implemented by classes annotated with * <p>To be implemented by classes annotated with
* {@link org.springframework.cache.annotation.EnableCaching} that wish * {@link org.springframework.cache.annotation.EnableCaching} that wish
* or need to specify explicitly how exception caches are resolved for * or need to specify explicitly how exception caches are resolved for
* annotation-driven cache management. Consider extending {@link JCacheConfigurerSupport}, * annotation-driven cache management.
* which provides a stub implementation of all interface methods.
* *
* <p>See {@link org.springframework.cache.annotation.EnableCaching} for * <p>See {@link org.springframework.cache.annotation.EnableCaching} for
* general examples and context; see {@link #exceptionCacheResolver()} for * general examples and context; see {@link #exceptionCacheResolver()} for
@ -36,7 +35,6 @@ import org.springframework.lang.Nullable;
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 4.1 * @since 4.1
* @see CachingConfigurer * @see CachingConfigurer
* @see JCacheConfigurerSupport
* @see org.springframework.cache.annotation.EnableCaching * @see org.springframework.cache.annotation.EnableCaching
*/ */
public interface JCacheConfigurer extends CachingConfigurer { public interface JCacheConfigurer extends CachingConfigurer {
@ -60,6 +58,8 @@ public interface JCacheConfigurer extends CachingConfigurer {
* See {@link org.springframework.cache.annotation.EnableCaching} for more complete examples. * See {@link org.springframework.cache.annotation.EnableCaching} for more complete examples.
*/ */
@Nullable @Nullable
CacheResolver exceptionCacheResolver(); default CacheResolver exceptionCacheResolver() {
return null;
}
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.cache.interceptor.SimpleKeyGenerator; import org.springframework.cache.interceptor.SimpleKeyGenerator;
@ -104,7 +104,7 @@ public class JCacheEhCacheAnnotationTests extends AbstractCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class EnableCachingConfig extends CachingConfigurerSupport { static class EnableCachingConfig implements CachingConfigurer {
@Autowired @Autowired
CachingProvider cachingProvider; CachingProvider cachingProvider;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -180,7 +180,7 @@ public class JCacheJavaConfigTests extends AbstractJCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
public static class EmptyConfigSupportConfig extends JCacheConfigurerSupport { public static class EmptyConfigSupportConfig implements JCacheConfigurer {
@Bean @Bean
public CacheManager cm() { public CacheManager cm() {
return new NoOpCacheManager(); return new NoOpCacheManager();
@ -190,7 +190,7 @@ public class JCacheJavaConfigTests extends AbstractJCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class FullCachingConfigSupport extends JCacheConfigurerSupport { static class FullCachingConfigSupport implements JCacheConfigurer {
@Override @Override
@Bean @Bean
@ -220,7 +220,7 @@ public class JCacheJavaConfigTests extends AbstractJCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class NoExceptionCacheResolverConfig extends JCacheConfigurerSupport { static class NoExceptionCacheResolverConfig implements JCacheConfigurer {
@Override @Override
@Bean @Bean

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.CacheErrorHandler; import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.SimpleKeyGenerator; import org.springframework.cache.interceptor.SimpleKeyGenerator;
import org.springframework.cache.jcache.config.JCacheConfigurerSupport; import org.springframework.cache.jcache.config.JCacheConfigurer;
import org.springframework.cache.support.SimpleCacheManager; import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
@ -141,7 +141,7 @@ public class JCacheErrorHandlerTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends JCacheConfigurerSupport { static class Config implements JCacheConfigurer {
@Bean @Bean
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -34,7 +34,7 @@ import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.cache.interceptor.KeyGenerator; import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.cache.interceptor.SimpleKey; import org.springframework.cache.interceptor.SimpleKey;
import org.springframework.cache.interceptor.SimpleKeyGenerator; import org.springframework.cache.interceptor.SimpleKeyGenerator;
import org.springframework.cache.jcache.config.JCacheConfigurerSupport; import org.springframework.cache.jcache.config.JCacheConfigurer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -97,7 +97,7 @@ public class JCacheKeyGeneratorTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends JCacheConfigurerSupport { static class Config implements JCacheConfigurer {
@Bean @Bean
@Override @Override
@ -151,7 +151,7 @@ public class JCacheKeyGeneratorTests {
@Override @Override
public Object generate(Object target, Method method, Object... params) { public Object generate(Object target, Method method, Object... params) {
assertThat(Arrays.equals(expectedParams, params)).as("Unexpected parameters: expected: " assertThat(Arrays.equals(expectedParams, params)).as("Unexpected parameters: expected: "
+ Arrays.toString(this.expectedParams) + " but got: " + Arrays.toString(params)).isTrue(); + Arrays.toString(this.expectedParams) + " but got: " + Arrays.toString(params)).isTrue();
return new SimpleKey(params); return new SimpleKey(params);
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,8 +26,7 @@ import org.springframework.lang.Nullable;
* Interface to be implemented by @{@link org.springframework.context.annotation.Configuration * Interface to be implemented by @{@link org.springframework.context.annotation.Configuration
* Configuration} classes annotated with @{@link EnableCaching} that wish or need to * Configuration} classes annotated with @{@link EnableCaching} that wish or need to
* specify explicitly how caches are resolved and how keys are generated for annotation-driven * specify explicitly how caches are resolved and how keys are generated for annotation-driven
* cache management. Consider extending {@link CachingConfigurerSupport}, which provides a * cache management.
* stub implementation of all interface methods.
* *
* <p>See @{@link EnableCaching} for general examples and context; see * <p>See @{@link EnableCaching} for general examples and context; see
* {@link #cacheManager()}, {@link #cacheResolver()} and {@link #keyGenerator()} * {@link #cacheManager()}, {@link #cacheResolver()} and {@link #keyGenerator()}
@ -37,7 +36,6 @@ import org.springframework.lang.Nullable;
* @author Stephane Nicoll * @author Stephane Nicoll
* @since 3.1 * @since 3.1
* @see EnableCaching * @see EnableCaching
* @see CachingConfigurerSupport
*/ */
public interface CachingConfigurer { public interface CachingConfigurer {
@ -64,7 +62,9 @@ public interface CachingConfigurer {
* See @{@link EnableCaching} for more complete examples. * See @{@link EnableCaching} for more complete examples.
*/ */
@Nullable @Nullable
CacheManager cacheManager(); default CacheManager cacheManager() {
return null;
}
/** /**
* Return the {@link CacheResolver} bean to use to resolve regular caches for * Return the {@link CacheResolver} bean to use to resolve regular caches for
@ -89,7 +89,9 @@ public interface CachingConfigurer {
* See {@link EnableCaching} for more complete examples. * See {@link EnableCaching} for more complete examples.
*/ */
@Nullable @Nullable
CacheResolver cacheResolver(); default CacheResolver cacheResolver() {
return null;
}
/** /**
* Return the key generator bean to use for annotation-driven cache management. * Return the key generator bean to use for annotation-driven cache management.
@ -110,7 +112,9 @@ public interface CachingConfigurer {
* See @{@link EnableCaching} for more complete examples. * See @{@link EnableCaching} for more complete examples.
*/ */
@Nullable @Nullable
KeyGenerator keyGenerator(); default KeyGenerator keyGenerator() {
return null;
}
/** /**
* Return the {@link CacheErrorHandler} to use to handle cache-related errors. * Return the {@link CacheErrorHandler} to use to handle cache-related errors.
@ -133,6 +137,8 @@ public interface CachingConfigurer {
* See @{@link EnableCaching} for more complete examples. * See @{@link EnableCaching} for more complete examples.
*/ */
@Nullable @Nullable
CacheErrorHandler errorHandler(); default CacheErrorHandler errorHandler() {
return null;
}
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ import org.springframework.beans.testfixture.beans.TestBean;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching; import org.springframework.cache.annotation.Caching;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCache; import org.springframework.cache.concurrent.ConcurrentMapCache;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
@ -306,7 +306,7 @@ public class CacheReproTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
public static class Spr13081Config extends CachingConfigurerSupport { public static class Spr13081Config implements CachingConfigurer {
@Bean @Bean
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -124,7 +124,7 @@ public class EnableCachingIntegrationTests {
@Configuration @Configuration
static class SharedConfig extends CachingConfigurerSupport { static class SharedConfig implements CachingConfigurer {
@Override @Override
@Bean @Bean

View File

@ -22,7 +22,7 @@ import org.springframework.beans.factory.BeanCreationException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException; import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.NoUniqueBeanDefinitionException; import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.interceptor.CacheErrorHandler; import org.springframework.cache.interceptor.CacheErrorHandler;
import org.springframework.cache.interceptor.CacheInterceptor; import org.springframework.cache.interceptor.CacheInterceptor;
@ -150,7 +150,7 @@ public class EnableCachingTests extends AbstractCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class EnableCachingConfig extends CachingConfigurerSupport { static class EnableCachingConfig implements CachingConfigurer {
@Override @Override
@Bean @Bean
@ -227,7 +227,7 @@ public class EnableCachingTests extends AbstractCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class MultiCacheManagerConfigurer extends CachingConfigurerSupport { static class MultiCacheManagerConfigurer implements CachingConfigurer {
@Bean @Bean
public CacheManager cm1() { public CacheManager cm1() {
@ -253,7 +253,7 @@ public class EnableCachingTests extends AbstractCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class EmptyConfigSupportConfig extends CachingConfigurerSupport { static class EmptyConfigSupportConfig implements CachingConfigurer {
@Bean @Bean
public CacheManager cm() { public CacheManager cm() {
@ -264,7 +264,7 @@ public class EnableCachingTests extends AbstractCacheAnnotationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class FullCachingConfig extends CachingConfigurerSupport { static class FullCachingConfig implements CachingConfigurer {
@Override @Override
@Bean @Bean

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
@ -122,7 +122,7 @@ public class ExpressionCachingIntegrationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class SharedConfig extends CachingConfigurerSupport { static class SharedConfig implements CachingConfigurer {
@Override @Override
@Bean @Bean

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -28,7 +28,7 @@ import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.support.SimpleCacheManager; import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.cache.support.SimpleValueWrapper; import org.springframework.cache.support.SimpleValueWrapper;
@ -170,7 +170,7 @@ public class CacheErrorHandlerTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends CachingConfigurerSupport { static class Config implements CachingConfigurer {
@Bean @Bean
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -27,7 +27,7 @@ import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CachePut; import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cache.concurrent.ConcurrentMapCacheManager; import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
@ -106,7 +106,7 @@ public class CachePutEvaluationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends CachingConfigurerSupport { static class Config implements CachingConfigurer {
@Bean @Bean
@Override @Override

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -29,7 +29,7 @@ import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager; import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -149,7 +149,7 @@ public class CacheResolverCustomizationTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends CachingConfigurerSupport { static class Config implements CachingConfigurer {
@Override @Override
@Bean @Bean

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2021 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -26,7 +26,7 @@ import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching; import org.springframework.cache.annotation.Caching;
import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.cache.annotation.CachingConfigurer;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@ -133,7 +133,7 @@ public class CacheSyncFailureTests {
@Configuration @Configuration
@EnableCaching @EnableCaching
static class Config extends CachingConfigurerSupport { static class Config implements CachingConfigurer {
@Override @Override
@Bean @Bean