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

Bean creation and dependency injection should not be performed before AfterDeploymentValidation

    XMLWordPrintable

Details

    • Clarification
    • Resolution: Obsolete
    • Major
    • 2.1 (Discussion)
    • None
    • None
    • None

    Description

      The spec is clear that it is not allowed to invoke BeanManager.getReference(), BeanManager.getInjectableReference() and BeanManager.createInstance() before AfterDeploymentValidation. I.e. it could be safely used during AfterDeploymentValidation and after the application initialization finished. The reason is that before ADV the set of beans/interceptors/decorators may not be complete and extensions can still affect the resolution.

      However, using InjectionTarget, UnmanagedInstance and Contextual.create() has the same risks. I think we should clarify the usage so that the spec is consistent.

      WRT backward compatibility - note that the container is permitted to define a non-portable mode to overcome problems with legacy applications not using CDI SPI properly.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mkouba@redhat.com Martin Kouba
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: