Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-556

JavaEE component classes injection support mode

XMLWordPrintable

    • Icon: Clarification Clarification
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 1.2.Final
    • Java EE integration
    • None

      From CDI 1.2 spec,
      An archive which:
      • contains a beans.xml file with the bean-discovery-mode of none, or,
      • contains an extension and no beans.xml file
      is not a bean archive.

      Do JavaEE component classes support injections in the non bean archives? The spec is not clear on this.

      Jozef said:
      Java EE spec states in "EE.5.2.5
      Annotations and Injection":

      "The component classes listed in Table EE.5-1 with support level Standard all support Java EE resource injection, as well as PostConstruct and PreDestroy callbacks. In addition, if CDI is enabled—which it is by default—these classes also support CDI injection, as described in Section EE.5.24, Support for Dependency Injection, and the use of interceptors."

      However, it is not clear what "if CDI is enabled" means. One can argue that "CDI is enabled" if the component class resides in a bean archive. The other interpretation (the one I personally prefer) might be that "CDI is enabled" if a CDI container is initialized for the application (i.e. there's at least one CDI bean archive).

      The CDI spec needs to be clear on this.

              Unassigned Unassigned
              emijiang6 Emily Jiang (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: