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 <[email protected]>
---
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 <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yevgeny Zaspitsky <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to