com.github.bootfastconfig.cache.L2CacheConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of boot-fast-config-cache Show documentation
Show all versions of boot-fast-config-cache Show documentation
Parent pom providing dependency and plugin management for applications
built with Maven
The newest version!
package com.github.bootfastconfig.cache;
import com.github.bootfastconfig.cache.properties.L2CacheProperties;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cache.caffeine.CaffeineCacheManager;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.cache.RedisCacheManager;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.listener.ChannelTopic;
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
/**
* @author mister
*/
@ConditionalOnClass(value = {CaffeineCacheManager.class, RedisCacheManager.class})
@ConditionalOnBean(value = {RedisCacheManager.class, CaffeineCacheManager.class, RedisTemplate.class})
public class L2CacheConfig implements InitializingBean {
@Autowired
private L2CacheProperties l2Cache;
@Autowired
private ConfigurableApplicationContext applicationContext;
@Autowired
private RedisTemplate