- DamoManager singleton 메서드 추가 및 README 예제 갱신

- 기존 생성자 방식 유지 - 점진적 singleton 전환 가능
This commit is contained in:
Rinjae
2026-06-22 10:15:44 +09:00
parent 3837b1a80e
commit 397529301b
2 changed files with 26 additions and 7 deletions
@@ -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;
}