선/후처리
BX Framework은 전체거래에 대하여 업무서비스호출하기 전에 수행되는 선처리, 업무서비스 호출한 후에 수행되는 후처리 모듈을 제공한다. 선처리/후처리 모듈을 Framework을 사용하게 될 사용자환경에 적합하게 커스터마이징할 수 있다.
1. 시스템 선/후처리
시스템 선처리, 후처리모듈은 전체거래에 대하여 업무서비스호출하기전/후에 수행되는 모듈이다.
모듈 | 설명 | 개발담당 |
---|---|---|
시스템선처리 |
전체거래에 대해여 공통적이고 필수적인 작업 수행 거래에 대한 수행여부를 결정하는 거래제어 수행 Framework이 사용하는 파라미터를 로드 |
Framework Customizing팀 |
시스템후처리 |
전체거래에 대해여 업무서비스가 처리완료된 후 공통 작업 수행 거래로그/에러로그 저장 |
Framework Customizing팀 |
1.1. 시스템 선처리
시스템 선처리 모듈은 bxm.PreProcessor 인터페이스를 구현하고 bxm-management-instance.xml의 preprocessor로 지정한다.
-
Service Endpoint 의 bxm-management-instance.xml
… <bxm-instance name="bxm-instance"> ... <context> ... <preprocessor classname="bxm.dft.service.processor.DefaultSystemPreProcessor" order="1"/> ...
-
bxm.PreProcessor
… boolean checkIfRunnableService( ControlParameters controlParameters); void preProcess( Context traceContext, ContextHeader header, IOmmObject requestData) throws Exception;
1.1.1. checkIfRunnableService
거래가 수행가능한 상태인 지 검사한다. 수행불가인 경우 RestrictedServiceOperationException를 발생시킨다. 앞의 Exception이 아닌 다른 Exception을 발생시켜야 한다면 preProcess메소드에서 거래제어에 관련 처리를 수행해도 상관이 없다.
입력/출력구분 | 파라미터 | 설명 |
---|---|---|
입력파라미터 |
ControlParameters controlParameters |
거래파라미터 |
반환값 |
boolean |
true : 수행가능 false : 수행불가, checkIfRunnableService를 호출한 ServiceExecutor에서 |
1.2. 시스템 후처리
시스템 후처리 모듈은 bxm.PostProcessor 인터페이스를 구현하고 bxm-management-instance.xml의 postprocessor로 지정한다.
-
Service Endpoint 의 bxm-management-instance.xml
… <bxm-instance name="bxm-instance"> ... <context> ... <postprocessor classname="bxm.dft.service.processor.DefaultSystemPostProcessor" order="1"/> ...
-
bxm.PostProcessor
… void postProcess(Context traceContext, ContextHeader header, IOmmObject requestData, IOmmObject responseData) throws Exception;
1.2.1. postProcess
후처리을 수행한다. 업무서비스를 수행한 뒤에 모든 거래에서 수행할 작업을 구현한다.
입력/출력구분 | 파라미터 | 설명 |
---|---|---|
입력파라미터 |
Context traceContext |
거래수행시 ServiceExecutor 수행기간동안 생성하여 유지 되는 Context객체 |
ContextHeader header |
거래의 시스템 헤더 객체 |
|
IOmmObject requestData |
거래의 업무서비스에 대한 입력데이터객체 |
|
IOmmObject responseData |
거래의 업무서비스에 대한 응답데이터객체 |
|
반환값 |
void |
2. 업무 선/후처리
업무 선처리, 후처리모듈은 특정어플리케이션별로 업무서비스호출하기전/후에 수행되는 모듈이다.
모듈 | 설명 | 개발담당 |
---|---|---|
업무선처리 |
어플리케이션별로 공통적으로 처리하는 로직 수행 어플리케이션별로 수행하는 공통 validation 어플리케이션별로 사용하는 파라미터를 로드 |
업무개발팀 |
업무후처리 |
어플리케이션별로 업무서비스가 완료된 이후 공통적으로 |
업무개발팀 |
2.1. 업무 선처리
업무 선처리 모듈은 bxm.app.ApplicationPreProcessorAdapter 클래스를 상속하고 어플리케이션의 bxm-application.xml의 preprocessor로 지정한다.
-
어플리케이션의 bxm-application.xml
… <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bxm-application ... type="online" reference-applications="" shared="true" loglevel="Default" name="BxmDftSmp"> <description>샘플용</description> ... <preprocessor order="1" classname="bxm.app.SimplePreProcessor"/> </bxm-application>
-
bxm.app.ApplicationPreProcessorAdapter
… @Override public boolean checkIfRunnableService( ControlParameters controlParameters) { return true; } @Override public abstract void preProcess( Context traceContext, ContextHeader header,IOmmObject requestData) throws Exception;
2.2. 업무 후처리
업무 후처리 모듈은 bxm.PostProcessor 인터페이스를 구현하고 어플리케이션의 bxm-application.xml의 postprocessor로 지정한다.
-
어플리케이션의 bxm-application.xml
… <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <bxm-application ... type="online" reference-applications="" shared="true" loglevel="Default" name="BxmDftSmp"> <description>샘플용</description> ... <postprocessor order="1" classname="bxm.app.SimplePostProcessor"/> </bxm-application>
-
bxm.PostProcessor
… void postProcess(Context traceContext, ContextHeader header, IOmmObject requestData, IOmmObject responseData) throws Exception;
2.2.1. postProcess
후처리을 수행한다. 업무서비스를 수행한 뒤에 수행할 작업을 구현한다.
입력/출력구분 | 파라미터 | 설명 |
---|---|---|
입력파라미터 |
Context traceContext |
거래수행시 ServiceExecutor 수행기간동안 생성하여 유지 되는 Context객체 |
ContextHeader header |
거래의 시스템 헤더 객체 |
|
IOmmObject requestData |
거래의 업무서비스에 대한 입력데이터객체 |
|
IOmmObject responseData |
거래의 업무서비스에 대한 응답데이터객체 |
|
반환값 |
void |