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

CDI Interceptor/Decorator order precendence when @Priority used and decorator defined in beans.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 2.2.10.SP1
    • None

      Hi,

      We would like clarification regarding what the expected behaviour according to the CDI 1.2 spec based on this use case.

      We have a project which has 2 Decorator classes ( Class A and B) which has the Priority enabled in the class via the @Priority annotatation whereby class A has a higher priority over class B based on the Priority annotation.

      In the same project, we have these 2 decorator classes defined in the file beans.xml whereby Class B is specified before Class A in the decorator element as below.

      When we execute the project we notice that Class A is enabled before Class B despite the definition of beans.xml overriding the order specified by the @Priority annotation. We would like to clarify the expected behaviour here based on the CDI 1.2 spec. Are decorators enabled using @Priority called before decorators enabled using beans.xml? Does the order of Decorators in beans.xml take precedence over those defined by the Priority annotation?

      beans.xml snippet:

      <interceptors>
      <class>Class B</class>
      <class>Class A</class>
      </interceptors>

      <decorators>
      <class>Class B</class>
      <class>Class A</class>
      </decorators>

      Thanks,
      David

            Unassigned Unassigned
            dwinters1980 David Winters (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: