kr.co.hit.live.batch
Class AbstractBatchScheduler

java.lang.Object
  extended by kr.co.hit.live.batch.AbstractBatchScheduler

public abstract class AbstractBatchScheduler
extends Object

배치 스케줄러 구현을 위한 상위 클래스이다. 실제 배치 스케줄러는 이 클래스를 상속받은 후 getScheduleEntries()와 executeBatch() 메소드를 구현해야 한다.

Author:
김형도

Field Summary
static String ARG_NODE_NAME
          배치 스케쥴러가 실행되는 논리적인 노드 명을 지정한다.
static String ARG_RUNTIME
          배치 스케줄러의 실행 시간을 지정한다.
static String ARG_SCHEDULER_SERVICE
          배치 스케줄러 서비스 명을 지정한다.
static String ARG_SERVICE_CONTAINER
          배치 스케줄러 서비스 객체를 얻기 위한 서비스 컨테이너 명칭을 지정한다.
static String ARG_SYSTEM_ERR_LOG
          배치 스케쥴러의 system.err을 log 파일로 보내고자 할 경우 이 파라메터를 log4j의 해당 Appender 명으로 설정한다.
static String ARG_SYSTEM_OUT_LOG
          배치 스케쥴러의 system.out을 log 파일로 보내고자 할 경우 이 파라메터를 log4j의 해당 Appender 명으로 설정한다.
static String ARG_UNTIL
          배치 스케줄러의 종료 시간을 지정한다.
protected static int HALF_DAY
           
protected static String LOCK_FILEPATH
          배치 스케줄러 중복 실행을 막기 귀한 Lock 파일 명
static long ONE_DAY
           
static long ONE_MINUTE
           
protected static Pattern paramPattern
          프로그램 파라메터의 세션변수나 날짜포멧 문자열을 실제 값으로 처리하기 위한 패턴 정의
protected static int TOP_OF_DAY
           
protected static int TOP_OF_HOUR
           
protected static int TOP_OF_MINUTE
           
protected static int TOP_OF_MONTH
           
protected static int TOP_OF_SECOND
           
protected static int TOP_OF_TROUBLE
          날짜 패턴의 타입을 구분하기 위한 상수 정의
protected static int TOP_OF_WEEK
           
protected static int TOP_OF_YEAR
           
 
Constructor Summary
AbstractBatchScheduler()
           
 
Method Summary
protected abstract  void executeBatch(long fireTime, ScheduleEntry sentry)
          실제 배치를 실행시키는 구현 부분이다.
protected abstract  ScheduleEntry[] getScheduleEntries()
          스케쥴 엔트리 목록을 조회한다.
protected  String[] getSchedulerNodes()
          스케쥴러가 실행되는 논리적인 노드 명을 반환한다.
static void main(String[] args)
           
protected  void parseArgument(String[] args)
          배치 스케쥴러의 기본 파라메터를 파싱한다.
protected  String parseParameters(String str, Map<String,String> sessionMap)
          $세션변수 또는 %날짜포멧 형태의 문자열을 실제 값으로 치환한다.
 void run()
          배치 스케줄러의 스케줄링 loop 를 실행한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ONE_MINUTE

public static final long ONE_MINUTE
See Also:
Constant Field Values

ONE_DAY

public static final long ONE_DAY
See Also:
Constant Field Values

ARG_NODE_NAME

public static final String ARG_NODE_NAME
배치 스케쥴러가 실행되는 논리적인 노드 명을 지정한다.(여러개면 ,를 구분자로 하여 나열함)

See Also:
Constant Field Values

ARG_RUNTIME

public static final String ARG_RUNTIME
배치 스케줄러의 실행 시간을 지정한다.(분)

See Also:
Constant Field Values

ARG_UNTIL

public static final String ARG_UNTIL
배치 스케줄러의 종료 시간을 지정한다.(HHmmss 형태의 문자열)

See Also:
Constant Field Values

ARG_SYSTEM_OUT_LOG

public static final String ARG_SYSTEM_OUT_LOG
배치 스케쥴러의 system.out을 log 파일로 보내고자 할 경우 이 파라메터를 log4j의 해당 Appender 명으로 설정한다.

See Also:
Constant Field Values

ARG_SYSTEM_ERR_LOG

public static final String ARG_SYSTEM_ERR_LOG
배치 스케쥴러의 system.err을 log 파일로 보내고자 할 경우 이 파라메터를 log4j의 해당 Appender 명으로 설정한다.

See Also:
Constant Field Values

ARG_SERVICE_CONTAINER

public static final String ARG_SERVICE_CONTAINER
배치 스케줄러 서비스 객체를 얻기 위한 서비스 컨테이너 명칭을 지정한다.

See Also:
Constant Field Values

ARG_SCHEDULER_SERVICE

public static final String ARG_SCHEDULER_SERVICE
배치 스케줄러 서비스 명을 지정한다.

See Also:
Constant Field Values

paramPattern

protected static final Pattern paramPattern
프로그램 파라메터의 세션변수나 날짜포멧 문자열을 실제 값으로 처리하기 위한 패턴 정의


LOCK_FILEPATH

protected static final String LOCK_FILEPATH
배치 스케줄러 중복 실행을 막기 귀한 Lock 파일 명

See Also:
Constant Field Values

TOP_OF_TROUBLE

protected static final int TOP_OF_TROUBLE
날짜 패턴의 타입을 구분하기 위한 상수 정의

See Also:
Constant Field Values

TOP_OF_SECOND

protected static final int TOP_OF_SECOND
See Also:
Constant Field Values

TOP_OF_MINUTE

protected static final int TOP_OF_MINUTE
See Also:
Constant Field Values

TOP_OF_HOUR

protected static final int TOP_OF_HOUR
See Also:
Constant Field Values

HALF_DAY

protected static final int HALF_DAY
See Also:
Constant Field Values

TOP_OF_DAY

protected static final int TOP_OF_DAY
See Also:
Constant Field Values

TOP_OF_WEEK

protected static final int TOP_OF_WEEK
See Also:
Constant Field Values

TOP_OF_MONTH

protected static final int TOP_OF_MONTH
See Also:
Constant Field Values

TOP_OF_YEAR

protected static final int TOP_OF_YEAR
See Also:
Constant Field Values
Constructor Detail

AbstractBatchScheduler

public AbstractBatchScheduler()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

getSchedulerNodes

protected String[] getSchedulerNodes()
스케쥴러가 실행되는 논리적인 노드 명을 반환한다.

Returns:

getScheduleEntries

protected abstract ScheduleEntry[] getScheduleEntries()
                                               throws LiveException
스케쥴 엔트리 목록을 조회한다.

Returns:
Throws:
LiveException

executeBatch

protected abstract void executeBatch(long fireTime,
                                     ScheduleEntry sentry)
                              throws LiveException
실제 배치를 실행시키는 구현 부분이다.

Parameters:
fireTime - 배치 실행 시간
sentry - 배치 스케쥴 엔트리 객체
Throws:
LiveException

run

public void run()
         throws IOException,
                ParseException
배치 스케줄러의 스케줄링 loop 를 실행한다.

Throws:
IOException
ParseException

parseArgument

protected void parseArgument(String[] args)
                      throws IOException
배치 스케쥴러의 기본 파라메터를 파싱한다.

Parameters:
args -
Throws:
IOException

parseParameters

protected String parseParameters(String str,
                                 Map<String,String> sessionMap)
$세션변수 또는 %날짜포멧 형태의 문자열을 실제 값으로 치환한다.

Parameters:
str -
sessionMap - 세션값들을 담고 있는 Map 객체
Returns:


Copyright © 2014. All Rights Reserved.