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

Details

    • Clarification
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Out of Date
    • 1.1.PRD
    • 1.1.PFD
    • None
    • None

    Description

      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>
      
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: