EAI 전후처리프로그램
프로그램용도 | 구현할 Java인터페이스 | 적용할 설정화면 |
---|---|---|
전후처리프로그램 | EaiPrePostProcess | 인터페이스관리>배치인터페이스 |
EAI에서 배치인터페이스 처리 시, 수행 전 & 후 & 에러 처리에 실행될 사용자 프로그램을 개발하여 적용할 수 있다.
개발방법
배치인터페이스 처리 전에 호출된다.
public void preProcess(EaiPrePostInfo eaiPrePostInfo);
배치인터페이스 처리 후에 호출된다.
public void postProcess(EaiPrePostInfo eaiPrePostInfo);
배치인터페이스 처리 중 예외가 발생할 경우 호출된다.
public void exceptionProcess(EaiPrePostInfo eaiPrePostInfo);
전체 예제
package bxi.extension.customizing.api;
import org.springframework.stereotype.Component;
import bxi.api.EaiPrePostProcess;
import bxi.api.model.EaiPrePostInfo;
import bxi.common.dao.dto.BxiEaiIntrfcIO;
import bxi.common.dao.dto.BxiEaiWorkHstIO;
import bxi.common.model.BxiMessage;
import bxi.common.utility.ObjectUtil;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Component
public class EaiPrePostImpl implements EaiPrePostProcess {
@Override
public void preProcess(EaiPrePostInfo eaiPrePostInfo) {
BxiMessage bxiMessage = eaiPrePostInfo.getBxiMessage();
BxiEaiIntrfcIO eaiIntrfc = eaiPrePostInfo.getEaiIntrfc();
if (!ObjectUtil.isEmpty(bxiMessage)) {
LOG.debug("Header Message : {}", bxiMessage.getStdHeader());
LOG.debug("Body Message : {}", bxiMessage.getBody());
}
LOG.debug("EAI ID : {}", eaiIntrfc.getEaiIntrfcId());
}
@Override
public void postProcess(EaiPrePostInfo eaiPrePostInfo) {
BxiEaiIntrfcIO eaiIntrfc = eaiPrePostInfo.getEaiIntrfc();
BxiEaiWorkHstIO eaiWorkHst = eaiPrePostInfo.getEaiWorkHst();
LOG.debug("EAI ID : {}", eaiIntrfc.getEaiIntrfcId());
LOG.debug("Source File Name : {}", eaiWorkHst.getSrcFileNm());
LOG.debug("Target File Name : {}", eaiWorkHst.getTargetFileNm());
}
@Override
public void exceptionProcess(EaiPrePostInfo eaiPrePostInfo) {
BxiMessage bxiMessage = eaiPrePostInfo.getBxiMessage();
BxiEaiIntrfcIO eaiIntrfc = eaiPrePostInfo.getEaiIntrfc();
if (!ObjectUtil.isEmpty(bxiMessage)) {
LOG.debug("Header Message : {}", bxiMessage.getStdHeader());
LOG.debug("Body Message : {}", bxiMessage.getBody());
}
LOG.debug("EAI ID : {}", eaiIntrfc.getEaiIntrfcId());
}
}