diff --git a/pom.xml b/pom.xml index a1bb1626..96b37a99 100644 --- a/pom.xml +++ b/pom.xml @@ -513,7 +513,8 @@ 1.2.0 --> - + + + + + + net.sf.ehcache + ehcache-core + 2.6.11 + + + commons-logging + commons-logging + + + + + org.springframework + spring-context-support + ${spring.maven.artifact.version} + diff --git a/src/main/java/kr/xit/framework/biz/cmm/service/impl/CacheServiceImpl.java b/src/main/java/kr/xit/framework/biz/cmm/service/impl/CacheServiceImpl.java index dae18c58..2c3482c5 100644 --- a/src/main/java/kr/xit/framework/biz/cmm/service/impl/CacheServiceImpl.java +++ b/src/main/java/kr/xit/framework/biz/cmm/service/impl/CacheServiceImpl.java @@ -43,6 +43,7 @@ public class CacheServiceImpl implements CacheService { return menuMapper.selectMenuListByUser(uniqId); } + @SuppressWarnings("unchecked") @Cacheable(cacheNames="menuCache", key = "#authorCode") @Override public List> findMenuListByAuthorCode(final String authorCode) { diff --git a/src/main/java/kr/xit/framework/core/config/CacheConfig3.java b/src/main/java/kr/xit/framework/core/config/CacheConfig3.java new file mode 100644 index 00000000..d41180e0 --- /dev/null +++ b/src/main/java/kr/xit/framework/core/config/CacheConfig3.java @@ -0,0 +1,34 @@ +/* +package kr.xit.framework.core.config; + +import java.net.URISyntaxException; +import java.net.URL; + +import org.springframework.cache.CacheManager; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.cache.jcache.JCacheCacheManager; +import org.springframework.cache.jcache.JCacheManagerFactoryBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +//@Configuration +//@EnableCaching +public class CacheConfig3 { + + @Bean + public CacheManager cacheManager() throws URISyntaxException { + return + new JCacheCacheManager(ehCacheManager().getObject()); + } + + @Bean + public JCacheManagerFactoryBean ehCacheManager() throws URISyntaxException { + + final URL confUrl = getClass().getResource("/spring/service/cache/ehcache3.xml"); + JCacheManagerFactoryBean cmfb = new JCacheManagerFactoryBean(); + cmfb.setCacheManagerUri(confUrl.toURI()); + //cmfb.setConfigLocation(new ClassPathResource("classpath:/spring/service/cache/ehcache3.xml")); + return cmfb; + } +} +*/ diff --git a/src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger.java b/src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger3.java similarity index 98% rename from src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger.java rename to src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger3.java index f034d9a6..ecedfe61 100644 --- a/src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger.java +++ b/src/main/java/kr/xit/framework/support/cache/EhCacheEventLogger3.java @@ -1,3 +1,4 @@ +/* package kr.xit.framework.support.cache; import org.ehcache.event.CacheEvent; @@ -12,3 +13,4 @@ public class EhCacheEventLogger implements CacheEventListener { log.info("cache event logger message::getKey: {} / getOldValue: {} / getNewValue:{}", cacheEvent.getKey(), cacheEvent.getOldValue(), cacheEvent.getNewValue()); } } +*/ diff --git a/src/main/resources/spring/context-service.xml b/src/main/resources/spring/context-service.xml index 8ef7f020..ce57b31b 100644 --- a/src/main/resources/spring/context-service.xml +++ b/src/main/resources/spring/context-service.xml @@ -7,7 +7,8 @@ - + + diff --git a/src/main/resources/spring/service/cache/context-ehcache.xml b/src/main/resources/spring/service/cache/context-ehcache.xml index a421303a..065ae090 100644 --- a/src/main/resources/spring/service/cache/context-ehcache.xml +++ b/src/main/resources/spring/service/cache/context-ehcache.xml @@ -1,14 +1,22 @@ - + - - - - - + + + + + + + + + + + diff --git a/src/main/resources/spring/service/cache/context-ehcache3.xml b/src/main/resources/spring/service/cache/context-ehcache3.xml new file mode 100644 index 00000000..7527cd47 --- /dev/null +++ b/src/main/resources/spring/service/cache/context-ehcache3.xml @@ -0,0 +1,15 @@ + + + + + + + + + + diff --git a/src/main/resources/spring/service/cache/ehcache.xml b/src/main/resources/spring/service/cache/ehcache.xml index 271c82e6..9c3df3f3 100644 --- a/src/main/resources/spring/service/cache/ehcache.xml +++ b/src/main/resources/spring/service/cache/ehcache.xml @@ -1,91 +1,70 @@ - - - + + + + - - - - - - kr.xit.framework.support.cache.EhCacheEventLogger - ASYNCHRONOUS - UNORDERED - CREATED - EVICTED - REMOVED - UPDATED - EXPIRED - - - + + - - java.lang.Object - java.lang.Object - - - - 5 - + + + - - - - - - - 100 - - 10 - - 50 - + - - java.lang.Object - java.lang.Object - - - - 5 - - - - - - - - - 100 - - 10 - - 50 - + - - java.lang.Object - java.lang.Object - - - - 5 - - - - - - - - - 100 - - 10 - - 50 - + - + diff --git a/src/main/resources/spring/service/cache/ehcache3.xml b/src/main/resources/spring/service/cache/ehcache3.xml new file mode 100644 index 00000000..6c831e5e --- /dev/null +++ b/src/main/resources/spring/service/cache/ehcache3.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + kr.xit.framework.support.cache.EhCacheEventLogger + ASYNCHRONOUS + UNORDERED + CREATED + EVICTED + REMOVED + UPDATED + EXPIRED + + + + + + java.lang.Object + java.lang.Object + + + + 5 + + + + + + + + + 100 + + 10 + + 50 + + + + + java.lang.Object + java.lang.Object + + + + 5 + + + + + + + + + 100 + + 10 + + 50 + + +