首页>代码>基于spring boot+layui+redis+activiti+Apache Shiro整合开发网站权限管理系统>/kvf-admin-activiti/kvf-admin-activiti/src/main/java/com/kalvin/kvf/common/config/EhCacheConfig.java
package com.kalvin.kvf.common.config; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.ehcache.EhCacheCacheManager; import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.io.ClassPathResource; /** * 缓存配置 */ @EnableCaching @Configuration @ConditionalOnProperty(name = "kvf.cache.enable", havingValue = "true") public class EhCacheConfig { @Bean public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() { EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean(); cacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml")); // 缓存信息配置文件 cacheManagerFactoryBean.setShared(true); return cacheManagerFactoryBean; } /** * ehcache 主要的管理器 * * @param cacheManagerFactoryBean cm * @return ec */ @Bean public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean cacheManagerFactoryBean) { return new EhCacheCacheManager(cacheManagerFactoryBean.getObject()); } }
最近下载更多
简约时尚 LV13
1月16日
skipple3 LV39
2023年10月26日
x1048446262 LV2
2023年8月30日
yoyoch1 LV1
2023年8月28日
3334004690 LV3
2023年8月15日
zhy1989wz LV6
2023年7月6日
微信网友_6482083022819328 LV9
2023年6月3日
oclocl LV1
2023年4月12日
lee123321 LV22
2023年3月27日
feixuewisdomlee LV1
2023年2月9日
最近浏览更多
梁智发 LV12
3月24日
Gin19960217 LV4
3月5日
微信网友_6844263371689984
1月30日
暂无贡献等级
简约时尚 LV13
1月16日
iiiiiiixiiiiii LV1
2023年12月31日
WBelong LV6
2023年12月27日
微信网友_6112748712497152
2023年11月27日
暂无贡献等级
lasttimeapp
2023年11月27日
暂无贡献等级
WanLiuYun LV12
2023年11月8日
内心向阳 LV4
2023年11月8日