首页>代码>基于SpringBoot+spring mvc+Mybatis+beetl+bootstrap实现的简洁开源网站后台管理系统Guns>/guns/guns-admin/src/main/java/com/stylefeng/guns/config/EhCacheConfig.java
package com.stylefeng.guns.config;

import net.sf.ehcache.CacheManager;
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;

/**
 * ehcache配置
 *
 * @author fengshuonan
 * @date 2017-05-20 23:11
 */
@Configuration
@EnableCaching
public class EhCacheConfig {

    /**
     * EhCache的配置
     */
    @Bean
    public EhCacheCacheManager cacheManager(CacheManager cacheManager) {
        return new EhCacheCacheManager(cacheManager);
    }

    /**
     * EhCache的配置
     */
    @Bean
    public EhCacheManagerFactoryBean ehcache() {
        EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean();
        ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml"));
        return ehCacheManagerFactoryBean;
    }
}
最近下载更多
1158919118  LV1 2023年12月13日
hhvivi  LV2 2023年7月2日
iceboard  LV2 2023年2月26日
1114581129  LV2 2022年7月6日
2468867327  LV10 2022年5月18日
菠萝蜜  LV3 2022年4月4日
Jackson_李  LV8 2022年3月24日
刘亦菲9527  LV15 2022年1月26日
暂无贡献等级
huaua7676  LV30 2021年11月23日
最近浏览更多
kkkxyh  LV13 2月11日
萌了个乖乖  LV12 2024年12月26日
bluerstar  LV1 2024年10月23日
微信网友_7134912998903808  LV15 2024年8月29日
fengst 2024年6月18日
暂无贡献等级
shuangfu  LV25 2024年5月7日
微信网友_6927932988952576  LV12 2024年3月31日
yxzzxy  LV3 2024年1月19日
1158919118  LV1 2023年12月13日
Hachi6  LV13 2023年12月12日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友