OBP 연계 모듈 프로퍼티 재로딩 지원
This commit is contained in:
@@ -2,6 +2,7 @@ package com.eactive.ext.kjb.obp;
|
||||
|
||||
import com.eactive.ext.kjb.common.KjbObpException;
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -11,12 +12,18 @@ public class KjbObpModule {
|
||||
|
||||
private static KjbObpModule _instance;
|
||||
|
||||
@Getter
|
||||
private final KjbProperty property;
|
||||
private final ObpClient client;
|
||||
|
||||
public static synchronized KjbObpModule getInstance(KjbProperty kjbProperty) {
|
||||
if (_instance == null) {
|
||||
_instance = new KjbObpModule(kjbProperty);
|
||||
} else {
|
||||
if (kjbProperty.equals(_instance.getProperty())) {
|
||||
log.debug("KjbProperty 파라미터가 변경되어 KjbObpModule 인스턴스 재 생성");
|
||||
_instance = new KjbObpModule(kjbProperty);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.eactive.ext.kjb.obp;
|
||||
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.hc.client5.http.classic.methods.HttpGet;
|
||||
@@ -23,6 +24,7 @@ import java.util.concurrent.*;
|
||||
public class ObpClient {
|
||||
private static ObpClient _instance;
|
||||
|
||||
@Getter
|
||||
private final KjbProperty property;
|
||||
private final CloseableHttpClient httpClient;
|
||||
private final RequestConfig requestConfig;
|
||||
@@ -31,6 +33,11 @@ public class ObpClient {
|
||||
public synchronized static ObpClient getInstance(KjbProperty kjbProperty) {
|
||||
if (_instance == null) {
|
||||
_instance = new ObpClient(kjbProperty);
|
||||
} else {
|
||||
if (kjbProperty.equals(_instance.getProperty())) {
|
||||
log.debug("KjbProperty 파라미터가 변경되어 ObpClient 인스턴스 재 생성");
|
||||
_instance = new ObpClient(kjbProperty);
|
||||
}
|
||||
}
|
||||
|
||||
return _instance;
|
||||
|
||||
Reference in New Issue
Block a user