- DamoManager singleton 메서드 추가 및 README 예제 갱신
- 기존 생성자 방식 유지 - 점진적 singleton 전환 가능
This commit is contained in:
@@ -63,6 +63,13 @@ public class DamoManager {
|
||||
private int nReturn;
|
||||
private final RealBridge bridge;
|
||||
|
||||
/**
|
||||
* 기존 생성자 사용은 유지하면서, 공용 singleton 인스턴스가 필요한 경우 사용.
|
||||
*/
|
||||
public static DamoManager getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
public DamoManager() {
|
||||
if (REAL_MODE) {
|
||||
this.bridge = new RealBridge();
|
||||
@@ -78,6 +85,10 @@ public class DamoManager {
|
||||
}
|
||||
}
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final DamoManager INSTANCE = new DamoManager();
|
||||
}
|
||||
|
||||
public String getRevision() {
|
||||
return this.szRevision;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user