}
}
public String getModuleImplementationClassName(WGAConfiguration config, ModuleRegistry registry) {
ModuleDefinition sourceDef = null;
// We must find the design source for this design, so it can tell us which provider implementation class we have
if (config != null) {
DesignSource sourceObj = config.getDesignConfiguration().getDesignSource(source);
if (sourceObj != null) {
sourceDef = registry.getModuleDefinition(DesignSourceModuleType.class, sourceObj.getImplClassName());
}
}
// If design source not found it may be singleton. We try to find the right one in registry
if (sourceDef == null) {
Iterator<ModuleDefinition> modDefs = registry.getModulesForType(DesignSourceModuleType.class).values().iterator();
while (modDefs.hasNext()) {
ModuleDefinition moduleDefinition = (ModuleDefinition) modDefs.next();
DesignSourceProperties props = (DesignSourceProperties) moduleDefinition.getProperties();
if (props != null && props.isSingleton() && props.getSingletonUID().equals(getSource())) {
sourceDef = moduleDefinition;
break;
}
}