Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-54

Add prduction to InjectionServices to allow container to inject constructor dependencies

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Obsolete
    • Major
    • None
    • None
    • Resolution
    • None

    Description

      The InjectionServices interface only allows injection into existing instances

      interface InjectionServices {

      /**

      • inject() will be called by Web Beans whenever it performs injection upon an
      • InjectionTarget or Bean.
        *
      • In an EE environment, inject() must perform EE-style injection on the instance, as
      • defined by annotations or deployment descriptors
        */
        void inject(Object instance);
        }

      Pete's example when explaining this to me is to make WB understand "foreign" annotations for injection, e.g.

      class MyBean
      {
      @org.jboss.mc.Inject TxManager tm;
      }

      I think it would make sense to expand this to support constructor injection (simliar to Producer.produce()), so we can do
      class MyBean
      {
      MyBean(@org.jboss.mc.Inject TxManager tm)
      {
      }
      }

      Attachments

        Issue Links

          Activity

            People

              pmuiratbleepbleep Pete Muir (Inactive)
              kkhan1@redhat.com Kabir Khan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: