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

Clarify behaviour if both a stereotype and a bean class is used to select/deselect an alternative bean

XMLWordPrintable

    • Icon: Clarification Clarification
    • Resolution: Obsolete
    • Icon: Major Major
    • 1.1.PFD
    • 1.1.PRD
    • None
    • None

      In CDI 1.1 a bean which has @Alternative stereotype applied may be selected using the bean class. If both a stereotype and a bean class is used to select/deselect an alternative bean, conflicts may occur (in the cotext of CDI-18). E.g.:

      @Stereotype
      @Alternative
      @Target({ TYPE, METHOD, FIELD })
      @Retention(RUNTIME)
      public @interface Mock {
      }
      
      @Mock
      class Foo {
      }
      
      <beans>
      <alternatives>
      <class priority="1000">org.mycompany.Foo</class&gt;
      <stereotype priority="100">org.mycompany.Mock</stereotype>
      </alternatives>
      </beans>
      
      

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

                Created:
                Updated:
                Resolved: