/**
* Make sure to have private default constructor.
* This avoids direct instantiation of class using
* new keyword/Class.newInstance() method
*/ private RegistrySingleton() {
}
public static synchronized RegistrySingleton getInstance(String moduleName) {
RegistrySingleton instance = null;
if (registry.containsKey(moduleName)) {
instance = registry.get(moduleName);
} else {
instance = new RegistrySingleton();
instance.moduleName = moduleName;
registry.put(moduleName, instance);
}
return instance;
}
public String getModuleName() { return moduleName;
}