Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-701

Add a new annotation to tell the Component Manager to automatically inject the result of a Factory

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 6.3
    • Component
    • None

    Description

      Right now we already support injecting the result of a Factory by using the @Provider annotation (equivalent of the @Instance annotation in CDI, which extends @Provider from javax.inject). For example:

      @Inject
      @Named("context")
      private Provider<ComponentManager> cmProvider;
      

      Here the idea is to be able to simply write:

      @Inject
      @Named("context")
      private ComponentManager cm;
      

      And if some class exists and has a special annotation (like @Producer) or some method annotated with @Produces (as it's in CDI, see https://docs.jboss.org/weld/reference/1.0.0/en-US/html/producermethods.html) then the result of that method is automatically injected.

      Attachments

        Activity

          People

            Unassigned Unassigned
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: