Java Code Examples for org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers

The following examples show how to use org.springframework.boot.autoconfigure.cache.CacheManagerCustomizers. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * 管理缓存
 *
 * @return
 */
@Bean
public CacheManager redisCacheManager(RedisConnectionFactory redisConnectionFactory,
                                      RedisGenericCacheProcessor redisGenericCacheProcessor,
                                      ObjectMapper objectMapper,
                                      CacheProperties cacheProperties,
                                      CacheManagerCustomizers customizerInvoker,
                                      ResourceLoader resourceLoader
) {

    RedisGenericCacheManager redisGenericCacheManager = new RedisGenericCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(redisConnectionFactory),
            determineConfiguration(resourceLoader.getClassLoader(), cacheProperties));
    redisGenericCacheManager.setCacheProperties(cacheProperties);
    redisGenericCacheManager.setGenericCacheMap(redisGenericCacheProcessor.getGenericCacheMap());
    redisGenericCacheManager.setObjectMapper(objectMapper);
    return customizerInvoker.customize(redisGenericCacheManager);
}
 
Example 2
MicaRedisCacheAutoConfiguration(RedisSerializer<Object> redisSerializer,
								CacheProperties cacheProperties,
								CacheManagerCustomizers customizerInvoker,
								ObjectProvider<RedisCacheConfiguration> redisCacheConfiguration) {
	this.redisSerializer = redisSerializer;
	this.cacheProperties = cacheProperties;
	this.customizerInvoker = customizerInvoker;
	this.redisCacheConfiguration = redisCacheConfiguration.getIfAvailable();
}
 
Example 3
Source Project: black-shop   Source File: RedisCacheAutoConfiguration.java    License: Apache License 2.0 5 votes vote down vote up
RedisCacheAutoConfiguration(CacheProperties cacheProperties,
							CacheManagerCustomizers customizerInvoker,
							ObjectProvider<RedisCacheConfiguration> redisCacheConfiguration) {
	this.cacheProperties = cacheProperties;
	this.customizerInvoker = customizerInvoker;
	this.redisCacheConfiguration = redisCacheConfiguration.getIfAvailable();
}
 
Example 4
CachingProviderAutoConfiguration(
		@Autowired(required = false) CacheProperties cacheProperties,
		@Autowired(required = false) CacheManagerCustomizers cacheManagerCustomizers) {

	this.cacheProperties = cacheProperties;
	this.cacheManagerCustomizers = cacheManagerCustomizers;
}
 
Example 5
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
	ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
	return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 6
Source Project: spring-microservice-exam   Source File: RedisConfig.java    License: MIT License 4 votes vote down vote up
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 7
Source Project: black-shop   Source File: RedisCacheManagerConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
public CacheManagerCustomizers cacheManagerCustomizers(
		ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
	return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 8
Source Project: gateway-helper   Source File: MultiCacheAutoConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 9
Source Project: gateway-helper   Source File: MultiCacheAutoConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(L2CacheManager.class)
public L2CacheManager cacheManager(RedisConnectionFactory connectionFactory,
                                   CacheManagerCustomizers customizerInvoker) {
    return customizerInvoker.customize(new RedisL2CacheManager(connectionFactory));
}
 
Example 10
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 11
Source Project: api-gateway-old   Source File: MultiCacheAutoConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean
public CacheManagerCustomizers cacheManagerCustomizers(
        ObjectProvider<List<CacheManagerCustomizer<?>>> customizers) {
    return new CacheManagerCustomizers(customizers.getIfAvailable());
}
 
Example 12
Source Project: api-gateway-old   Source File: MultiCacheAutoConfig.java    License: Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(L2CacheManager.class)
public L2CacheManager cacheManager(RedisConnectionFactory connectionFactory,
                                   CacheManagerCustomizers customizerInvoker) {
    return customizerInvoker.customize(new RedisL2CacheManager(connectionFactory));
}
 
Example 13
Optional<CacheManagerCustomizers> getCacheManagerCustomizers() {
	return Optional.ofNullable(this.cacheManagerCustomizers);
}