Alon Bar-Lev has posted comments on this change. Change subject: core: introduce context pattern ......................................................................
Patch Set 21: (5 comments) http://gerrit.ovirt.org/#/c/28829/21/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java: Line 454: public VdcReturnValueBase endAction(VdcActionType actionType, Line 455: VdcActionParametersBase parameters, Line 456: CommandContext context) { Line 457: CommandBase<?> command = Line 458: context != null ? CommandsFactory.createCommand(actionType, parameters, context.duplicate()) : context must be non null Line 459: CommandsFactory.createCommand(actionType, parameters); Line 460: return command.endAction(); Line 461: } Line 462: http://gerrit.ovirt.org/#/c/28829/21/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/CommandContext.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/CommandContext.java: Line 14: Line 15: /** Line 16: * Holds common attributes to all engine flows Line 17: */ Line 18: private EngineContext engineContext; final please Line 19: Line 20: /** Line 21: * The Lock in the command context is used by the parent command to pass to the child command locks the child needs Line 22: * to acquire. Line 78: Line 79: @Override Line 80: public Object clone() throws CloneNotSupportedException { Line 81: super.clone(); Line 82: return this.duplicate(); I still do not understand why duplicate does not call clone... especially now that you add this super() Line 83: Line 84: } Line 85: Line 86: private void setFromContext(CommandContext context) { http://gerrit.ovirt.org/#/c/28829/21/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/QueryContext.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/context/QueryContext.java: Line 1: package org.ovirt.engine.core.bll.context; Line 2: Line 3: public class QueryContext { Line 4: Line 5: private EngineContext engineContext; final please Line 6: Line 7: public QueryContext(EngineContext engineContext) { Line 8: this.engineContext = engineContext; Line 9: } http://gerrit.ovirt.org/#/c/28829/21/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java: Line 42: private List<StorageDomain> domains = new ArrayList<>(); Line 43: private List<LUNs> luns = new ArrayList<>(); Line 44: Line 45: public UpdateStorageServerConnectionCommand(T parameters) { Line 46: super(parameters, null); why not just add a super which does not accept context? this will avoid patching all these no? Line 47: } Line 48: Line 49: @Override Line 50: protected boolean canDoAction() { -- To view, visit http://gerrit.ovirt.org/28829 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I310f5f77fff78b3232ee77fe63791425fd521516 Gerrit-PatchSet: 21 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org 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