Yair Zaslavsky has posted comments on this change.

Change subject: 8. [WIP] core: Introducing Extension manager
......................................................................


Patch Set 22:

(3 comments)

http://gerrit.ovirt.org/#/c/24365/22/backend/manager/modules/extension-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ExtensionManager.java
File 
backend/manager/modules/extension-manager/src/main/java/org/ovirt/engine/core/extensions/mgr/ExtensionManager.java:

Line 75:         public Map<ExtensionProperties, Object> getContext() {
Line 76:             return context;
Line 77:         }
Line 78: 
Line 79:         public Extension getExtension() {
> I would put it as private :)
Done
Line 80:             return extension;
Line 81:         }
Line 82: 
Line 83:         public void setExtension(Extension extension) {


Line 200:                 throw new ConfigurationException(String.format("The 
module '%1$s' does not contain the type '%2$s'.",
Line 201:                         module.getIdentifier().getName(),
Line 202:                         
extensionEntry.getConfig().getProperty(CLASS)));
Line 203:             }
Line 204:             extensionEntry.setExtension(extensionClass.newInstance());
> what about setContext?
done.
Line 205:             extensionEntry.getExtension().init();
Line 206:         } catch (InstantiationException | IllegalAccessException | 
IllegalArgumentException e) {
Line 207:             throw new ConfigurationException(String.format("Error in 
instantitating extension based on tye type '%1$'",
Line 208:                     extensionEntry.getConfig().getProperty(CLASS)));


Line 215:     private void activate() {
Line 216:         for (ExtensionEntry entry : loadedEntries.values()) {
Line 217:             if (entry.enabled) {
Line 218:                 activatedEntries.put(entry.getName(), entry);
Line 219:                 createExtension(entry, 
loadModule(entry.getConfig().getProperty(MODULE)));
> I do not like createExtension modify the entry... I think it should be:
Agree to all your comments.
About the last sentence - does this mean that if there is an exception in 
creating/initializing an exception we move on to the next one? as the 
exceptions that are thrown extend RuntimeException the looo will not continue.
Actually I think it makes sense to catch exceptions - if someone developed an 
extension in a wrong way, other extensions should not "suffer" from it.
Line 220:                 List<ExtensionEntry> entries = 
providesEntries.get(entry.getProvides());
Line 221:                 if (entries == null) {
Line 222:                     entries = new ArrayList<>();
Line 223:                     providesEntries.put(entry.getProvides(), entries);


-- 
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: 22
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Martin PeÅ™ina <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to