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 <rgo...@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 <rgo...@redhat.com> Gerrit-Reviewer: Alexander Wels <aw...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Asaf Shakarchi <a...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Einav Cohen <eco...@redhat.com> Gerrit-Reviewer: Eli Mesika <emes...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Itamar Heim <ih...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Liran Zelkha <lzel...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Maor Lipchuk <mlipc...@redhat.com> Gerrit-Reviewer: Mike Kolesnik <mkole...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> Gerrit-Reviewer: Vojtech Szocs <vsz...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Yevgeny Zaspitsky <yzasp...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches