From Roy Golan <rgolan(a)redhat.com>:
Roy Golan has submitted this change and it was merged.
Change subject: core: Use CDI.current() to remove internal deps from Injector
......................................................................
core: Use CDI.current() to remove internal deps from Injector
Since CDI spec 1.2 programatic lookup can be achieved using the
CDI.current() which locates the CDI implementation and has a reference
to the BeanManager. Thus the injector needs not to be a part of the EJB
lifecycle and can be moved to utils.
The usage of Injector is mainly for unmanaged code. Direct usage of
CDI.current().select(Some.class, Annotations...) is preferred and more
complete and the usage of Injector can be kept only to to help with
injecting members into commands (i.e the various command factories we
have)
- Injector is no more a Bean, all inner deps are being removed
- Uses CDI.current() to do programmatic lookups
- Prefer CDI.current().select(Bean...) over Injector.get(Bean...)
- Simplified InjectorRule impl
Change-Id: Ibc60a4a38a184954f782e3ca3b5563fc55050776
Signed-off-by: Roy Golan <rgolan(a)redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/VmHandlerTest.java
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/di/Injector.java
M
backend/manager/modules/vdsbroker/src/test/java/org/ovirt/engine/core/di/InjectorRule.java
4 files changed, 129 insertions(+), 64 deletions(-)
Approvals:
Jakub Niedermertl: Looks good to me, but someone else must approve
Martin Peřina: Looks good to me, but someone else must approve
Jenkins CI: Passed CI tests
Martin Betak: Verified
Roy Golan: Verified; Looks good to me, approved
--
To view, visit
https://gerrit.ovirt.org/63747
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc60a4a38a184954f782e3ca3b5563fc55050776
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir(a)redhat.com>
Gerrit-Reviewer: Jakub Niedermertl <jniederm(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar(a)redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina(a)redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey(a)redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori(a)redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Shmuel Leib Melamud <smelamud(a)redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn(a)redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>