Alon Bar-Lev has posted comments on this change. Change subject: aaa: Adding engineSessionId on CommandContext ......................................................................
Patch Set 10: (5 comments) Great! looks great! next is to remove the usage of setContext() http://gerrit.ovirt.org/#/c/28829/10/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MultipleActionsRunner.java: Line 190 Line 191 Line 192 Line 193 Line 194 I will really like to see that we use the context of constructor and modify it instead of replacing. http://gerrit.ovirt.org/#/c/28829/10/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsEventListener.java: Line 247: ExecutionContext executionContext = new ExecutionContext(); Line 248: executionContext.setMonitored(true); Line 249: Backend.getInstance().runInternalMultipleActions(VdcActionType.MigrateVmToServer, Line 250: new ArrayList<>(createMigrateVmToServerParametersList(vmsToMigrate, vds)), Line 251: new CommandContext(executionContext)); new CommandContext().setExecutionContext() Line 252: } Line 253: } catch (RuntimeException e) { Line 254: log.errorFormat("Failed to initialize Vds on up. Error: {0}", e); Line 255: } http://gerrit.ovirt.org/#/c/28829/10/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 5 Line 6 Line 7 Line 8 Line 9 cloneable Line 101: if (context == null) { Line 102: engineSessionId = params.getSessionId(); Line 103: } else { Line 104: setFromContext(context); Line 105: } see last comment Line 106: Line 107: } Line 108: Line 109: private void setFromContext(CommandContext context) { Line 115: public CommandContext duplicate() { Line 116: CommandContext ctx = new CommandContext(); Line 117: ctx.setFromContext(this); Line 118: return ctx; Line 119: } please use clone Line 120: Line 121: public String getEngineSessionId() { Line 122: return engineSessionId; Line 123: } -- 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: 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: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@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