Roy Golan has submitted this change and it was merged.
Change subject: core: [CDI] Introduce CDI for Commands dependencies
......................................................................
core: [CDI] Introduce CDI for Commands dependencies
introducing the use of the powerfull yet light weld framework for
injecting dependencies to our Command objects.
command object are not EJBs and they have no reason to be ones.
Yet they carry lots of dependencies although they are a cardinal part of
the system they are hard to test.
using weld's tools we can inject dependencies programmaticly, letting
weld figure out how to fulfill all annotated fields.
this means the CommandFactory is responsible for instantiating a new
instance and dependency injection (as long as commands are not CDI
beans)
@See
InjectionHelper
a helper with a refrence to weld's bean manager which
we fullfuill dependecies programmatically with
jboss-deplpoyment-structure.xml
The mechanism jboss uses to define additional mofules/dependencies that
help discover beans inside modules. nessecary for cross-module
resolution (e.g inject a utils/Logger to bll/CommandBase
META-INF/beans.xml
a marker file to signal the deployment scanner to start bean discovery
on the jar/war/ear (for war file it should be under WEB-INF/beans.xml)
FUTURE (following patches)
* All singletons will move to be @ApplicationScopped beans
* Commands will never use dependecies inside the constructre. all init
goes into @postConstruct method
* No JNDI usage - all can be injected instead
* No EJB beans - unless out use-case is relevant
* create empty META-INF/beans.xml file.
* create default empty consturctor for Backend
Change-Id: I7f604ff91847b698efe84a09f724ba0492a672c1
Signed-off-by: Roy Golan <rgolan(a)redhat.com>
---
M backend/manager/modules/bll/pom.xml
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/Backend.java
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandsFactory.java
A
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/BllCDIAdapter.java
A backend/manager/modules/bll/src/main/resources/META-INF/beans.xml
M backend/manager/modules/common/pom.xml
A
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/Injector.java
M
backend/manager/modules/common/src/main/modules/org/ovirt/engine/core/common/main/module.xml
A backend/manager/modules/common/src/main/resources/META-INF/beans.xml
M backend/manager/modules/pom.xml
M
backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/log/LogFactory.java
A ear/src/main/application/META-INF/jboss-deployment-structure.xml
M packaging/services/ovirt-engine/ovirt-engine.xml.in
M pom.xml
14 files changed, 193 insertions(+), 4 deletions(-)
Approvals:
Roy Golan: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/5575
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I7f604ff91847b698efe84a09f724ba0492a672c1
Gerrit-PatchSet: 16
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Alexander Wels <awels(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Asaf Shakarchi <asaf(a)redhat.com>
Gerrit-Reviewer: Doron Fediuck <dfediuck(a)redhat.com>
Gerrit-Reviewer: Einav Cohen <ecohen(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik(a)redhat.com>
Gerrit-Reviewer: Itamar Heim <iheim(a)redhat.com>
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Liran Zelkha <lzelkha(a)redhat.com>
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Mike Kolesnik <mkolesni(a)redhat.com>
Gerrit-Reviewer: Moti Asayag <masayag(a)redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofrenkel(a)redhat.com>
Gerrit-Reviewer: Ravi Nori <rnori(a)redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan(a)redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Vojtech Szocs <vszocs(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: Yevgeny Zaspitsky <yzaspits(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer(a)redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server