From d516e38fd44e186f393bbb05c4e7ca34b323b609 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期二, 16 五月 2023 18:50:52 +0800
Subject: [PATCH] optimize report
---
java110-core/src/main/java/com/java110/core/cache/CacheConfiguration.java | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/java110-core/src/main/java/com/java110/core/cache/CacheConfiguration.java b/java110-core/src/main/java/com/java110/core/cache/CacheConfiguration.java
new file mode 100755
index 0000000..c0f195f
--- /dev/null
+++ b/java110-core/src/main/java/com/java110/core/cache/CacheConfiguration.java
@@ -0,0 +1,37 @@
+package com.java110.core.cache;
+
+import org.springframework.beans.factory.annotation.Configurable;
+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.core.io.ClassPathResource;
+
+/**
+ * Created by wuxw on 2017/7/23.
+ */
+//@Configurable
+//@EnableCaching
+public class CacheConfiguration {
+
+ /*
+ * ehcache 涓昏鐨勭鐞嗗櫒
+ */
+ //@Bean(name = "appEhCacheCacheManager")
+ public EhCacheCacheManager ehCacheCacheManager(EhCacheManagerFactoryBean bean){
+ return new EhCacheCacheManager (bean.getObject());
+ }
+
+ /*
+ * 鎹畇hared涓庡惁鐨勮缃�,Spring鍒嗗埆閫氳繃CacheManager.create()鎴杗ew CacheManager()鏂瑰紡鏉ュ垱寤轰竴涓猠hcache鍩哄湴.
+ */
+ //@Bean
+ public EhCacheManagerFactoryBean ehCacheManagerFactoryBean(){
+ EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean ();
+ cacheManagerFactoryBean.setConfigLocation (new ClassPathResource("cache/ehcache-app.xml"));
+ cacheManagerFactoryBean.setShared (true);
+ return cacheManagerFactoryBean;
+ }
+
+
+}
--
Gitblit v1.8.0