kr.co.hit.live.web.mapper
Class AutoReloadMapReader

java.lang.Object
  extended by kr.co.hit.live.web.mapper.CachedMapReader
      extended by kr.co.hit.live.web.mapper.AutoReloadMapReader
All Implemented Interfaces:
MapReader

public class AutoReloadMapReader
extends CachedMapReader

주어진 ID에 해당되는 ActionMap 객체를 반환해주는 클래스이다. 내부적으로 MapParser를 사용하여 Map 정의 파일(xml)을 파싱하며, MapDirectory를 사용하여 Map 정의 파일에 대한 File 객체를 얻어온다.

한번 파싱되어 생성된 ActionMap 객체는 내부에 캐싱하여 재사용한다. 이때 Map 파일의 최근 수정시간을 확인하여 한번 캐싱된 이후에 수정된 Map 파일은 다시 파싱한다.

Since:
4.0
Author:
김형도

Field Summary
 
Fields inherited from class kr.co.hit.live.web.mapper.CachedMapReader
cache, mapDir
 
Constructor Summary
AutoReloadMapReader(String root)
          생성자.
 
Method Summary
 ActionMap getMap(String path, String id)
          주어진 ID에 해당되는 SubmissionMap 객체를 반환한다.
 
Methods inherited from class kr.co.hit.live.web.mapper.CachedMapReader
cacheMap, getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoReloadMapReader

public AutoReloadMapReader(String root)
생성자. Map 파일이 있는 디렉토리의 위치를 지정하여 생성한다.

Parameters:
root -
Method Detail

getMap

public ActionMap getMap(String path,
                        String id)
                 throws IOException,
                        SAXException
Description copied from interface: MapReader
주어진 ID에 해당되는 SubmissionMap 객체를 반환한다. 해당 Map 파일이 존재하지 않거나 Xml 파싱시 오류가 발행한 경우에는 null을 반환한다.

Specified by:
getMap in interface MapReader
Overrides:
getMap in class CachedMapReader
Parameters:
path - map 파일이 있는 상대 경로
id - map 파일의 ID
Returns:
Throws:
IOException
SAXException


Copyright © 2014. All Rights Reserved.