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

BeforeBeanDiscovery and AfterTypeDiscovery new addAnnotatedType methods don't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 3.0.0.Alpha17
    • None
    • None

      Adding this code in extension doesn't create a MetricRegistry bean

      public void addMetricRegistryAnnotatedType(@Observes AfterTypeDiscovery atd) {
              atd.addAnnotatedType(MetricRegistry.class.getName(),MetricRegistry.class)
                      .add(ApplicationScoped.Literal.INSTANCE);
      }
      

      Same if done in BeforeBeanDiscovery observer

      Of course doing it the old way works

      public void addMetricRegistryAnnotatedType(@Observes AfterTypeDiscovery atd, BeanManager bm) {
       atd.addAnnotatedType(bm.createAnnotatedType(MetricRegistry.class),MetricRegistry.class.getName());
      }
      

            tremes1@redhat.com Tomas Remes
            asabotdu@redhat.com Antoine Sabot-Durand (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: