Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-1097

ProcessInjectionTarget event is fired when BeanManager.createInjectionTarget or InjectionTargetFactory.createInjectionTarget is called

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 1.6.2
    • None
    • Lifecycle
    • None

    Description

      In the following example:

      class CdiCamelExtension implements Extension {
      
          <T extends CamelContext> void camelContextBeans(@Observes ProcessInjectionTarget<T> pit) {
          }
      
          void addDefaultCamelContext(@Observes AfterBeanDiscovery abd, BeanManager manager) {  
              manager.createInjectionTarget(manager.createAnnotatedType(DefaultCamelContext.class));
       
              manager.getInjectionTargetFactory(
                  manager.createAnnotatedType(DefaultCamelContext.class))
                      .createInjectionTarget((Bean<DefaultCamelContext>) manager.resolve(manager.getBeans(DefaultCamelContext.class)));
          }
      }
      

      Both calls to BeanManager.createInjectionTarget or InjectionTargetFactory.createInjectionTarget triggers the firing of the ProcessInjectionTarget event.

      From my understanding of the specification, that should not be the case. What is surprising as well is that the ProcessInjectionTarget observer method is called within the execution of the AfterBeanDiscovery observer method.

      Attachments

        Activity

          People

            struberg Mark Struberg
            antonin.stefanutti Antonin Stefanutti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: