Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1602

Interceptors are not sorted correctly while intercept-ordering is used on override method name style

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0
    • 4.0
    • interceptors
    • None

    Description

      In current OpenEJB interceptor sorting algorithm, four levels are defined : PACKAGE, CLASS, OVERLOADED_METHOD, EXACT_METHOD. While from the spec side, it only configures three level : PACKAGE, CLASS, METHOD, And the OVERLOADED_METHOD is a solution to configure some methods with the same name at once. In the sample below, we will got a incorrect interceptor ordering :
      class MyBean {
      @Interceptors{{Interceptor1.class, Interceptor2.class}}
      public method1()
      }

      In the deployment plan, we have the configurations below :

      <interceptor-binding>
      <ejb-name>MyBean </ejb-name>
      <interceptor-order>
      <interceptor-class>org.apache.openejb.interceptor.Interceptor2</interceptor-class>
      <interceptor-class>org.apache.openejb.interceptor.Interceptor1</interceptor-class>
      </interceptor-order>
      <method>
      <method-name>method1</method-name>
      </method>
      </interceptor-binding>

      Per the description in the spec about interceptor-order, the final order should be interceptor2 -> interceptor1. while now the final order is interceptor1, interceptor2, interceptor2, interceptor1. The root cause for it is that we have an extra level.

      Attachments

        Activity

          People

            xuhaihong Haihong Xu
            xuhaihong Haihong Xu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: