|
|
@ -5,20 +5,17 @@ import com.github.benmanes.caffeine.cache.stats.CacheStats;
|
|
|
|
import kr.xit.biz.cmm.mapper.ICmmEnsCacheMapper;
|
|
|
|
import kr.xit.biz.cmm.mapper.ICmmEnsCacheMapper;
|
|
|
|
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
|
|
|
|
import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
|
|
|
|
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
|
|
|
|
import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO;
|
|
|
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
|
|
|
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiInfo;
|
|
|
|
|
|
|
|
import kr.xit.biz.ens.model.nice.NiceCiDTO.NiceCiRequest;
|
|
|
|
import kr.xit.core.spring.config.cache.CacheKeyGenerator;
|
|
|
|
import kr.xit.core.spring.config.cache.CacheKeyGenerator;
|
|
|
|
import kr.xit.core.spring.config.cache.CachingConfig;
|
|
|
|
|
|
|
|
import kr.xit.core.spring.config.cache.CacheType;
|
|
|
|
import kr.xit.core.spring.config.cache.CacheType;
|
|
|
|
|
|
|
|
import kr.xit.core.spring.config.cache.CachingConfig;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
|
|
|
|
|
import org.springframework.cache.CacheManager;
|
|
|
|
import org.springframework.cache.CacheManager;
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
|
|
import org.springframework.cache.caffeine.CaffeineCache;
|
|
|
|
import org.springframework.cache.caffeine.CaffeineCache;
|
|
|
|
import org.springframework.core.env.Environment;
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
@ -77,8 +74,8 @@ public class CmmEnsCacheService implements ICmmEnsCacheService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@Cacheable(cacheNames = "rlaybsnmInfo", keyGenerator = "cacheKeyGenerator")
|
|
|
|
@Cacheable(cacheNames = "rlaybsnmInfo", keyGenerator = "cacheKeyGenerator")
|
|
|
|
public <T> CmmEnsRlaybsnmDTO getRlaybsnmInfoCache(final T t) {
|
|
|
|
public CmmEnsRlaybsnmDTO getRlaybsnmInfoCache(final CmmEnsRequestDTO dto) {
|
|
|
|
return cmmEnsMapper.selectEnsRlaybsnmInfo(t);
|
|
|
|
return cmmEnsMapper.selectEnsRlaybsnmInfo(dto);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -88,7 +85,7 @@ public class CmmEnsCacheService implements ICmmEnsCacheService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@CacheEvict(cacheNames = "rlaybsnmInfo", keyGenerator = "cacheKeyGenerator")
|
|
|
|
@CacheEvict(cacheNames = "rlaybsnmInfo", keyGenerator = "cacheKeyGenerator")
|
|
|
|
public <T> void removeRlaybsnmInfoCache(final T t) {
|
|
|
|
public void removeRlaybsnmInfoCache(final CmmEnsRequestDTO dto) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -99,10 +96,11 @@ public class CmmEnsCacheService implements ICmmEnsCacheService {
|
|
|
|
for(String cacheName : cacheManager.getCacheNames()) {
|
|
|
|
for(String cacheName : cacheManager.getCacheNames()) {
|
|
|
|
Cache cache = ((CaffeineCache) cacheManager.getCache(cacheName)).getNativeCache();
|
|
|
|
Cache cache = ((CaffeineCache) cacheManager.getCache(cacheName)).getNativeCache();
|
|
|
|
|
|
|
|
|
|
|
|
// for(Object key : cache.asMap().keySet()) {
|
|
|
|
for(Object key : cache.asMap().keySet()) {
|
|
|
|
// Object value = cache.getIfPresent(key);
|
|
|
|
Object value = cache.getIfPresent(key);
|
|
|
|
|
|
|
|
log.info("key: {}", key);
|
|
|
|
//log.info("key: {} - value: {}", key, value.toString());
|
|
|
|
//log.info("key: {} - value: {}", key, value.toString());
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CacheStats stats = cache.stats();
|
|
|
|
CacheStats stats = cache.stats();
|
|
|
|
log.info("cache '{}' - stats : {}", cacheName, stats.toString());
|
|
|
|
log.info("cache '{}' - stats : {}", cacheName, stats.toString());
|
|
|
|