Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-586

Interceptors added by portable extensions don't work

    XMLWordPrintableJSON

Details

    Description

      The CDI Spec says "During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process".
      In OWB, Interceptors added programatically during these lifecycle events are NOT added to our interceptor stack in org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl.addBean(Bean<?>).

      In org.apache.webbeans.portable.events.discovery.AfterBeanDiscoveryImpl.addBean(Bean<?>) we create a CustomInterceptor that wraps the passed interceptor. We then add this CustomInterceptor to a set of org.apache.webbeans.container.BeanManagerImpl.webBeansInterceptors.

      Unfortunately multiple CustomInterceptor instances evaluate to the same hashcode and different interceptors overwrite one another when they get added to the Set. Consequently the right set of interceptors does not fire when a managed bean is to be intercepted.

      The fix to this issue is for CustomInterceptor and WebBeansInterceptor to override the default equals and hashcode methods.

      This bug causes 6 tests of the org.jboss.jsr299.tck.tests.interceptors.definition.custom.CustomInterceptorTest to FAIL.

      Attachments

        1. testCustomInterceptor.jar
          13 kB
          Rohit Dilip Kelapure

        Activity

          People

            struberg Mark Struberg
            kelapure Rohit Dilip Kelapure
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified