====== [적용 예] Cache ======
===== 개요 =====
[[egovframework:rte:fdl:cache|Cache]] Service 를 적용해서 공통코드를 생성한다.
===== 설명 =====
==== Configuration ====
=== resources\spring\context-cache.xml ===
=== resources\spring\ehcache-default.xml ===
==== Source ====
=== egovframework\rte\cvpl\web\EgovCvplMainController.java ===
@Resource(name="ehcache")
Ehcache gCache ;
Ehcache cache = gCache.getCacheManager().getCache("cvplCmmCd");
String chCode = "";
List cvplCmmnCdList = cvplCmmnCdService.selectCvplCmmnCdList();
List mainCdList = new ArrayList();
for (Iterator i = cvplCmmnCdList.iterator(); i.hasNext(); ) {
CvplCmmnCdVO cvlpCmmnCdVO = (CvplCmmnCdVO)i.next();
.
.
.
cache.put(new Element(chCode, mainCdList));
.
.
.
}
=== egovframework\rte\cvpl\common\EgovCvplCmmn.java ===
@Resource(name="ehcache")
Ehcache gCache ;
Ehcache cache = gCache.getCacheManager().getCache("cvplCmmCd");
Element el = cache.get(key);