Change in ovirt-engine[master]: core: Use CDI.current() to remove internal deps from Injector

Code Review gerrit at ovirt.org
Wed Nov 9 10:27:04 UTC 2016


>From Roy Golan <rgolan at 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 at 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 at redhat.com>
Gerrit-Reviewer: Andrej Krejcir <akrejcir at redhat.com>
Gerrit-Reviewer: Jakub Niedermertl <jniederm at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Jenny Tokar <jtokar at redhat.com>
Gerrit-Reviewer: Martin Betak <mbetak at redhat.com>
Gerrit-Reviewer: Martin Peřina <mperina at redhat.com>
Gerrit-Reviewer: Martin Sivák <msivak at redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag at redhat.com>
Gerrit-Reviewer: Phillip Bailey <phbailey at redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori at redhat.com>
Gerrit-Reviewer: Roman Mohr <rmohr at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Shmuel Leib Melamud <smelamud at redhat.com>
Gerrit-Reviewer: Yanir Quinn <yquinn at redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list