Alon Bar-Lev has posted comments on this change. Change subject: 6. [WIP] core: Introducing configuration loader ......................................................................
Patch Set 10: (5 comments) http://gerrit.ovirt.org/#/c/24365/10/backend/manager/modules/extension-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ConfigurationLoader.java File backend/manager/modules/extension-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ConfigurationLoader.java: Line 104: } Line 105: Line 106: public void load(EngineLocalConfig config) throws ConfigurationException { Line 107: File customExtensionsDir = config.getCustomExtensionsDir(); Line 108: File builtInExtensionsDir = config.getBuiltInExtensionsDir(); you really do not need these temp variables.... Line 109: load(customExtensionsDir); Line 110: load(builtInExtensionsDir); Line 111: activate(); Line 112: } Line 131: public List<ExtensionEntry> getExtensionsByService(String serviceName) { Line 132: return serviceEntries.get(serviceName); Line 133: } Line 134: Line 135: private void loadFile(File file) throws ConfigurationException { please reorder so that all loads will be at same place... please reorder so that all public (interface) will be either first or last. Line 136: // Load the configuration file: Line 137: Configuration config = null; Line 138: try { Line 139: config = Configuration.loadFile(file); Line 137: Configuration config = null; Line 138: try { Line 139: config = Configuration.loadFile(file); Line 140: ExtensionEntry entry = Line 141: new ExtensionEntry(file, config); why can't the entry read the file? Line 142: ExtensionEntry alreadyLoded = loadedEntries.get(entry.getName()); Line 143: if (alreadyLoded != null) { Line 144: throw new ConfigurationException("Could not load the configuration file \"" + file.getAbsolutePath() Line 145: + "\". The configuration file + \"" + alreadyLoded.file.getAbsolutePath() Line 154: exception); Line 155: } Line 156: } Line 157: Line 158: public ExtensionEntry getExtensionByName(String pluginName) throws ConfigurationException { please reorder so that all getExtensionXXX will be at one place. Line 159: ExtensionEntry result = loadedEntries.get(pluginName); Line 160: if (result == null) { Line 161: throw new ConfigurationException("No configuration was found for extension named " + pluginName); Line 162: } http://gerrit.ovirt.org/#/c/24365/10/backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/EngineLocalConfig.java File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/EngineLocalConfig.java: Line 224 Line 225 Line 226 Line 227 Line 228 no... this should be gotten from configuration like any other, put it in: packaging/services/ovirt-engine/ovirt-engine.conf.in see ENGINE_JAVA_MODULEPATH for example. same for the getCustomExtensionDir... use variables from the configuration, do not construct it here. -- To view, visit http://gerrit.ovirt.org/24365 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I182904177ec088e62b35bde870ec79725fabc4e4 Gerrit-PatchSet: 10 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches