use of com.serotonin.m2m2.module.ModelDefinition in project ma-core-public by infiniteautomation.
the class ModuleRegistry method ensureModelDefinitions.
private static void ensureModelDefinitions() {
if (MODEL_DEFINITIONS == null) {
synchronized (LOCK) {
if (MODEL_DEFINITIONS == null) {
Map<String, ModelDefinition> map = new HashMap<String, ModelDefinition>();
for (ModelDefinition def : Module.getDefinitions(preDefaults, ModelDefinition.class)) {
map.put(def.getModelTypeName(), def);
}
for (Module module : MODULES.values()) {
for (ModelDefinition def : module.getDefinitions(ModelDefinition.class)) map.put(def.getModelTypeName(), def);
}
for (ModelDefinition def : Module.getDefinitions(postDefaults, ModelDefinition.class)) {
map.put(def.getModelTypeName(), def);
}
MODEL_DEFINITIONS = map;
}
}
}
}
Aggregations