SpringBoot整合Redis作为缓存(二)

sping能使用redis存储数据后,下一步Spring整合Redis作为缓存。

Spring整合Redis作为缓存

原理:

1.在此之前当我们在pom.xml dependencies 中引入redis starter依赖以后

<dependencies>
    <!--Redis 缓存-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-redis</artifactId>
    </dependency>
 
</dependencies>

2.打开Spring配置报告 debug=true

3.在日志中已经看到: RedisCacheConfiguration 已经注入

RedisCacheConfiguration matched:
      - Cache org.springframework.boot.autoconfigure.cache.RedisCacheConfiguration automatic cache type (CacheCondition)

RedisCacheConfiguration已经匹配。

SimpleCacheConfiguration:
      Did not match:
         - @ConditionalOnMissingBean (types: org.springframework.cache.CacheManager; SearchStrategy: all) found bean 'cacheManager' (OnBeanCondition)

SimpleCacheConfiguration没有匹配。

说明:

4.RedisCacheConfiguration替换ConcurrentMapCacheManager

默认注入SimpleCacheConfiguration

ConcurrentMapCacheManager 创建缓存组件:ConcurrentMapCache

ConcurrentMapCache 使用 ConcurrentMap<Object, Object> store 存储缓存。

1.RedisCacheConfiguration

RedisCacheConfiguration 为容器注入了新的缓存管理器 RedisCacheManager ,其他的CacheManager将不在起作用。

容器中由 ConcurrentMapCacheManager 变为 RedisCacheManager

源码:

package org.springframework.boot.autoconfigure.cache;

......
    
@Configuration
@AutoConfigureAfter(RedisAutoConfiguration.class)
@ConditionalOnBean(RedisTemplate.class)
@ConditionalOnMissingBean(CacheManager.class)
@Conditional(CacheCondition.class)
class RedisCacheConfiguration {

   private final CacheProperties cacheProperties;

   private final CacheManagerCustomizers customizerInvoker;

   RedisCacheConfiguration(CacheProperties cacheProperties,
         CacheManagerCustomizers customizerInvoker) {
      this.cacheProperties = cacheProperties;
      this.customizerInvoker = customizerInvoker;
   }

   @Bean
   public RedisCacheManager cacheManager(RedisTemplate<Object, Object> redisTemplate) {
      RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
      cacheManager.setUsePrefix(true);
      List<String> cacheNames = this.cacheProperties.getCacheNames();
      if (!cacheNames.isEmpty()) {
         cacheManager.setCacheNames(cacheNames);
      }
      return this.customizerInvoker.customize(cacheManager);
   }

}
  • 由此得知 RedisCacheManager在操作数据时使用的是RedisTemplate<Object, Object> redisTemplate

    进而,我们在创建CacheManager时可以考虑使用RedisCacheManager操作我们指定RedisTemplate,进而方式乱码。


至此我们已经知道,redis缓存已经默认的起效了。测试下是否生效:

缓存配置:

  @Cacheable(cacheNames = {"Emp", "temp"}, key = "#id")
    public Employee getEmployee(Integer id) {
        System.out.println("①查询一个员工:" + id);
        return employeeMapper.getEmpById(id);
    }

调用查询方法: localhost:8080/emp/4

返回:

{
  "id": 4,
  "lastName": "lisi",
  "gender": null,
  "email": "123@123.com",
  "dId": null
}

redis中存储了存在:


2019-03-01 10.45.44.png

redis中对象存在乱码,上一章节中存储数据也出现乱码。

需要我们处理乱码:

2.RedisTemplate

RedisCacheConfiguration源码中看出:

    @Bean
    public RedisCacheManager cacheManager(RedisTemplate<Object, Object> redisTemplate) {
        RedisCacheManager cacheManager = new RedisCacheManager(redisTemplate);
        cacheManager.setUsePrefix(true);
        List<String> cacheNames = this.cacheProperties.getCacheNames();
        if (!cacheNames.isEmpty()) {
            cacheManager.setCacheNames(cacheNames);
        }
        return this.customizerInvoker.customize(cacheManager);
    }

RedisCacheManager 默认是操作 RedisTemplate<Object, Object> redisTemplate 操作数据的。

RedisTemplate<K, V> redisTemplate 默认使用的 JdkSerializationRedisSerializer 序列化数据,导致乱码的。

RedisTemplate默认使用JDK源码:

package org.springframework.data.redis.core;
....

public class RedisTemplate<K, V> extends RedisAccessor implements RedisOperations<K, V>, BeanClassLoaderAware {
    
....

  if (defaultSerializer == null) {

     defaultSerializer = new JdkSerializationRedisSerializer(
           classLoader != null ? classLoader : this.getClass().getClassLoader());
  }
   
....

}

问题

我们需要:

  1. 为存储对象创建自定义redisTemplate: RedisTemplate<Object, 自定义对象> redisTemplate

    上一章用spring操作redis已经配置过。不再需要配置新的。

  2. 为存储对象创建自定义的RedisCacheManager:并且将自定义的redisTemplate传入。

  3. 为存储对象指定自定义的RedisCacheManager。

顺带了解下RedisTemplate<Object, Object> redisTemplate由来:

RedisTemplate<Object, Object> redisTemplate 是由 RedisAutoConfiguration自动注入时创建的

源码:

package org.springframework.boot.autoconfigure.data.redis;
   
  ....

@Configuration
@ConditionalOnClass({ JedisConnection.class, RedisOperations.class, Jedis.class })
@EnableConfigurationProperties(RedisProperties.class)
public class RedisAutoConfiguration {

    ....
  
  /**
   * Standard Redis configuration.
   */
  @Configuration
  protected static class RedisConfiguration {

      @Bean
      @ConditionalOnMissingBean(name = "redisTemplate")
      public RedisTemplate<Object, Object> redisTemplate(
              RedisConnectionFactory redisConnectionFactory)
              throws UnknownHostException {
          RedisTemplate<Object, Object> template = new RedisTemplate<Object, Object>();
          template.setConnectionFactory(redisConnectionFactory);
          return template;
      }

      @Bean
      @ConditionalOnMissingBean(StringRedisTemplate.class)
      public StringRedisTemplate stringRedisTemplate(
              RedisConnectionFactory redisConnectionFactory)
              throws UnknownHostException {
          StringRedisTemplate template = new StringRedisTemplate();
          template.setConnectionFactory(redisConnectionFactory);
          return template;
      }

  }

}

3.RedisCacheManager

RedisCacheManager为我们创建**RedisCache **作为缓存组件。源码如下

RedisCacheManager在操作数据时使用的是RedisTemplate<Object, Object> redisTemplate

源码:


package org.springframework.data.redis.cache;

public class RedisCacheManager extends AbstractTransactionSupportingCacheManager {
 
   ....
   
   @Deprecated
   protected Cache createAndAddCache(String cacheName) {

      Cache cache = super.getCache(cacheName);
      return cache != null ? cache : createCache(cacheName);
   }
   ......
    

   @SuppressWarnings("unchecked")
   protected RedisCache createCache(String cacheName) {
      long expiration = computeExpiration(cacheName);
      return new RedisCache(cacheName, (usePrefix ? cachePrefix.prefix(cacheName) : null), redisOperations, expiration,
            cacheNullValues);
   }

 .....
}

4.RedisCache

RedisCache组件 通过操作redis数据存储到数据库中。

此时容器中的bean:注入了默认的 cacheManager (<u>附件1.没有自定义CacheManager之前IO中所有的bean</u>)

5.自定义CacheManager

RedisCacheManager可以用RedisTemplate操作数据

这里我们也使用 RedisCacheManager,可以用它来操作 RedisTemplate<Object, Object>

这里的value可以指定我们操作的对象:RedisTemplate<Object, Employee>

RedisCacheManager cacheManager = new RedisCacheManager(employeeRedisTemplate);

添加新的配置信息:

package com.invi.cache.config;

...
    
@Configuration
public class CustomRedisConfig {

    @Bean("maizi-employeeRedisTemplate")
    public RedisTemplate<Object, Employee> employeeRedisTemplate(
            RedisConnectionFactory redisConnectionFactory)
            throws UnknownHostException {
        RedisTemplate<Object, Employee> employeeRedisTemplate = new RedisTemplate<Object, Employee>();
        employeeRedisTemplate.setConnectionFactory(redisConnectionFactory);
        //设置默认序列化器
        Jackson2JsonRedisSerializer<Employee> employeeSerializer = new Jackson2JsonRedisSerializer<Employee>(Employee.class);
        employeeRedisTemplate.setDefaultSerializer(employeeSerializer);
        return employeeRedisTemplate;
    }


    //CacheManagerCustomizers 可以定制缓存规则
    //生效条件@ConditionalOnMissingBean(CacheManager.class)
    @Bean("maizi-employeeCacheManager")
    public RedisCacheManager employeeCacheManager(RedisTemplate<Object, Employee> employeeRedisTemplate) {
        RedisCacheManager cacheManager = new RedisCacheManager(employeeRedisTemplate);
        //启用CacheName作为Key的前缀
        cacheManager.setUsePrefix(true);
        return cacheManager;
    }

}
    
  • @Primary注意设置默认的CacheManager
  • @Bean默认名字方法名,这里使用自定义,方便看IO中的组件名

自定义的 maizi-employeeCacheManager如何生效的?

在RedisCacheConfiguration有类注解

@ConditionalOnMissingBean(CacheManager.class)

得知,当我们新增的employeeCacheManager时,容器替换了系统的CacheManager。

6.使用自定义RedisCacheManager

上一步我们已经创建好自定义CacheManager,maizi-employeeCacheManager

有两种使用方法:

  • 为一个方法中指定

    @Cacheable(cacheNames = {"Emp", "temp"}, 
               key = "#id", 
               cacheManager = "maizi-employeeCacheManager")
    public Employee getEmployee(Integer id) {
        System.out.println("①查询一个员工:" + id);
        return employeeMapper.getEmpById(id);
    }
    
  • 为一个类指定

    //抽取缓存的公共配置
    @CacheConfig(cacheNames = {"Emp", "temp"},
                 cacheManager = "maizi-employeeCacheManager")
    @Service
    public class EmployeeService {
       ......
    }
    

7.非注解使用自定义RedisCacheManager

package com.invi.cache.service;

import com.invi.cache.bean.Department;
import com.invi.cache.bean.Employee;
import com.invi.cache.mapper.DepartmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;


@Service
public class DepartmentService {


    @Autowired
    DepartmentMapper departmentMapper;
 

    //方法内部,不通过注解使用缓存。
    //指定使用的缓存管理器
    @Autowired
    @Qualifier("maizi-departmentCacheManager")
    CacheManager departmentCacheManager;

    
    public Department getDepartmentById(Integer id) {

        Department department = departmentMapper.getDepartmentById(id);
        //获取缓存
        Cache dept = departmentCacheManager.getCache("dept");
        //存储缓存
        dept.put("getDeptById", department);
        return department;
    }

}



至此,完结,撒花~

附件:

附件1.没有注入自定义CacheManager之前IO中所有的bean

存在cacheManager

basicErrorController
beanNameHandlerMapping
beanNameViewResolver
cacheAutoConfigurationValidator
cacheInterceptor
cacheManager
cacheManagerCustomizers
cacheOperationSource
characterEncodingFilter
conventionErrorViewResolver
customCachingConfig
customKeyGenerator
customRedisConfig
dataSource
dataSourceInitializer
dataSourceInitializerPostProcessor
defaultServletHandlerMapping
defaultValidator
defaultViewResolver
departmentController
departmentMapper
departmentService
dispatcherServlet
dispatcherServletRegistration
duplicateServerPropertiesDetector
embeddedServletContainerCustomizerBeanPostProcessor
employeeController
employeeMapper
employeeService
error
errorAttributes
errorPageCustomizer
errorPageRegistrarBeanPostProcessor
faviconHandlerMapping
faviconRequestHandler
handlerExceptionResolver
hiddenHttpMethodFilter
httpPutFormContentFilter
httpRequestHandlerAdapter
jacksonGeoModule
jacksonObjectMapper
jacksonObjectMapperBuilder
jdbcTemplate
jsonComponentModule
keyValueMappingContext
localeCharsetMappingsCustomizer
maizi-departmentRedisTemplate
maizi-employeeRedisTemplate
maizi-keyGenerator
mappingJackson2HttpMessageConverter
messageConverters
methodValidationPostProcessor
multipartConfigElement
multipartResolver
mvcContentNegotiationManager
mvcConversionService
mvcHandlerMappingIntrospector
mvcPathMatcher
mvcResourceUrlProvider
mvcUriComponentsContributor
mvcUrlPathHelper
mvcValidator
mvcViewResolver
mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties
namedParameterJdbcTemplate
org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
org.springframework.aop.config.internalAutoProxyCreator
org.springframework.boot.autoconfigure.AutoConfigurationPackages
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
org.springframework.boot.autoconfigure.cache.RedisCacheConfiguration
org.springframework.boot.autoconfigure.condition.BeanTypeRegistry
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConnectionConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$PooledDataSourceConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$DataSourceTransactionManagerConfiguration
org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration
org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$TomcatDataSourcePoolMetadataProviderConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration$CglibAutoProxyConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$TransactionTemplateConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration
org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration
org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration
org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration$RestTemplateConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration$TomcatWebSocketConfiguration
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.store
org.springframework.boot.test.mock.mockito.MockitoPostProcessor
org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor
org.springframework.cache.annotation.ProxyCachingConfiguration
org.springframework.cache.config.internalCacheAdvisor
org.springframework.context.annotation.internalAutowiredAnnotationProcessor
org.springframework.context.annotation.internalCommonAnnotationProcessor
org.springframework.context.annotation.internalConfigurationAnnotationProcessor
org.springframework.context.annotation.internalRequiredAnnotationProcessor
org.springframework.context.event.internalEventListenerFactory
org.springframework.context.event.internalEventListenerProcessor
org.springframework.data.web.config.ProjectingArgumentResolverRegistrar
org.springframework.data.web.config.SpringDataJacksonConfiguration
org.springframework.data.web.config.SpringDataWebConfiguration
org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration
org.springframework.transaction.config.internalTransactionAdvisor
org.springframework.transaction.config.internalTransactionalEventListenerFactory
pageableResolver
persistenceExceptionTranslationPostProcessor
platformTransactionManagerCustomizers
preserveErrorControllerTargetClassPostProcessor
projectingArgumentResolverBeanPostProcessor
propertySourcesPlaceholderConfigurer
redisConnectionFactory
redisConverter
redisCustomConversions
redisKeyValueAdapter
redisKeyValueTemplate
redisReferenceResolver
redisTemplate
requestContextFilter
requestMappingHandlerAdapter
requestMappingHandlerMapping
resourceHandlerMapping
restTemplateBuilder
serverProperties
simpleControllerHandlerAdapter
sortResolver
spring.cache-org.springframework.boot.autoconfigure.cache.CacheProperties
spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties
spring.http.multipart-org.springframework.boot.autoconfigure.web.MultipartProperties
spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties
spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties
spring.mvc-org.springframework.boot.autoconfigure.web.WebMvcProperties
spring.redis-org.springframework.boot.autoconfigure.data.redis.RedisProperties
spring.resources-org.springframework.boot.autoconfigure.web.ResourceProperties
spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties
springboot01CacheApplication
sqlSessionFactory
sqlSessionTemplate
standardJacksonObjectMapperBuilderCustomizer
stringHttpMessageConverter
stringRedisTemplate
tomcatEmbeddedServletContainerFactory
tomcatPoolDataSourceMetadataProvider
transactionAttributeSource
transactionInterceptor
transactionManager
transactionTemplate
viewControllerHandlerMapping
viewResolver
websocketContainerCustomizer
welcomePageHandlerMapping

附件2.已经注入自定义CacheManager之后IO中所有的bean

发现默认的CacheManager将被以下取代:

maizi-cacheManager
maizi-departmentCacheManager
maizi-departmentRedisTemplate
maizi-employeeCacheManager

basicErrorController
beanNameHandlerMapping
beanNameViewResolver
cacheInterceptor
cacheOperationSource
characterEncodingFilter
conventionErrorViewResolver
customCachingConfig
customKeyGenerator
customRedisConfig
dataSource
dataSourceInitializer
dataSourceInitializerPostProcessor
defaultServletHandlerMapping
defaultValidator
defaultViewResolver
departmentController
departmentMapper
departmentService
dispatcherServlet
dispatcherServletRegistration
duplicateServerPropertiesDetector
embeddedServletContainerCustomizerBeanPostProcessor
employeeController
employeeMapper
employeeService
error
errorAttributes
errorPageCustomizer
errorPageRegistrarBeanPostProcessor
faviconHandlerMapping
faviconRequestHandler
handlerExceptionResolver
hiddenHttpMethodFilter
httpPutFormContentFilter
httpRequestHandlerAdapter
jacksonGeoModule
jacksonObjectMapper
jacksonObjectMapperBuilder
jdbcTemplate
jsonComponentModule
keyValueMappingContext
localeCharsetMappingsCustomizer
maizi-cacheManager
maizi-departmentCacheManager
maizi-departmentRedisTemplate
maizi-employeeCacheManager
maizi-employeeRedisTemplate
maizi-keyGenerator
mappingJackson2HttpMessageConverter
messageConverters
methodValidationPostProcessor
multipartConfigElement
multipartResolver
mvcContentNegotiationManager
mvcConversionService
mvcHandlerMappingIntrospector
mvcPathMatcher
mvcResourceUrlProvider
mvcUriComponentsContributor
mvcUrlPathHelper
mvcValidator
mvcViewResolver
mybatis-org.mybatis.spring.boot.autoconfigure.MybatisProperties
namedParameterJdbcTemplate
org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
org.springframework.aop.config.internalAutoProxyCreator
org.springframework.boot.autoconfigure.AutoConfigurationPackages
org.springframework.boot.autoconfigure.condition.BeanTypeRegistry
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration$RedisConnectionConfiguration
org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$PooledDataSourceConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Tomcat
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$DataSourceTransactionManagerConfiguration
org.springframework.boot.autoconfigure.jdbc.JdbcTemplateAutoConfiguration
org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration
org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProvidersConfiguration$TomcatDataSourcePoolMetadataProviderConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$EnableTransactionManagementConfiguration$CglibAutoProxyConfiguration
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration$TransactionTemplateConfiguration
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration
org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletRegistrationConfiguration
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration
org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$DefaultErrorViewResolverConfiguration
org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration
org.springframework.boot.autoconfigure.web.HttpEncodingAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration
org.springframework.boot.autoconfigure.web.HttpMessageConvertersAutoConfiguration$StringHttpMessageConverterConfiguration
org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration
org.springframework.boot.autoconfigure.web.JacksonHttpMessageConvertersConfiguration$MappingJackson2HttpMessageConverterConfiguration
org.springframework.boot.autoconfigure.web.MultipartAutoConfiguration
org.springframework.boot.autoconfigure.web.ServerPropertiesAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration
org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration$RestTemplateConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter
org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter$FaviconConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration
org.springframework.boot.autoconfigure.websocket.WebSocketAutoConfiguration$TomcatWebSocketConfiguration
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor
org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.store
org.springframework.boot.test.mock.mockito.MockitoPostProcessor
org.springframework.boot.test.mock.mockito.MockitoPostProcessor$SpyPostProcessor
org.springframework.cache.annotation.ProxyCachingConfiguration
org.springframework.cache.config.internalCacheAdvisor
org.springframework.context.annotation.internalAutowiredAnnotationProcessor
org.springframework.context.annotation.internalCommonAnnotationProcessor
org.springframework.context.annotation.internalConfigurationAnnotationProcessor
org.springframework.context.annotation.internalRequiredAnnotationProcessor
org.springframework.context.event.internalEventListenerFactory
org.springframework.context.event.internalEventListenerProcessor
org.springframework.data.web.config.ProjectingArgumentResolverRegistrar
org.springframework.data.web.config.SpringDataJacksonConfiguration
org.springframework.data.web.config.SpringDataWebConfiguration
org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration
org.springframework.transaction.config.internalTransactionAdvisor
org.springframework.transaction.config.internalTransactionalEventListenerFactory
pageableResolver
persistenceExceptionTranslationPostProcessor
platformTransactionManagerCustomizers
preserveErrorControllerTargetClassPostProcessor
projectingArgumentResolverBeanPostProcessor
propertySourcesPlaceholderConfigurer
redisConnectionFactory
redisConverter
redisCustomConversions
redisKeyValueAdapter
redisKeyValueTemplate
redisReferenceResolver
redisTemplate
requestContextFilter
requestMappingHandlerAdapter
requestMappingHandlerMapping
resourceHandlerMapping
restTemplateBuilder
serverProperties
simpleControllerHandlerAdapter
sortResolver
spring.datasource-org.springframework.boot.autoconfigure.jdbc.DataSourceProperties
spring.http.encoding-org.springframework.boot.autoconfigure.web.HttpEncodingProperties
spring.http.multipart-org.springframework.boot.autoconfigure.web.MultipartProperties
spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties
spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties
spring.mvc-org.springframework.boot.autoconfigure.web.WebMvcProperties
spring.redis-org.springframework.boot.autoconfigure.data.redis.RedisProperties
spring.resources-org.springframework.boot.autoconfigure.web.ResourceProperties
spring.transaction-org.springframework.boot.autoconfigure.transaction.TransactionProperties
springboot01CacheApplication
sqlSessionFactory
sqlSessionTemplate
standardJacksonObjectMapperBuilderCustomizer
stringHttpMessageConverter
stringRedisTemplate
tomcatEmbeddedServletContainerFactory
tomcatPoolDataSourceMetadataProvider
transactionAttributeSource
transactionInterceptor
transactionManager
transactionTemplate
viewControllerHandlerMapping
viewResolver
websocketContainerCustomizer
welcomePageHandlerMapping

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 216,372评论 6 498
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 92,368评论 3 392
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 162,415评论 0 353
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,157评论 1 292
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,171评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,125评论 1 297
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,028评论 3 417
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,887评论 0 274
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,310评论 1 310
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,533评论 2 332
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,690评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,411评论 5 343
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,004评论 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,659评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,812评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,693评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,577评论 2 353