Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-5346

Shared filters registered through DynamicFeature are not considered

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.7
    • 3.0.0-milestone1, 2.7.8
    • JAX-RS
    • None
    • Unknown

    Description

      When a shared filter is registered through a DynamicFeature implementation, it's not considered when reaching the matching resource :

      @Provider
      public class DynamicFilterBinder implements DynamicFeature {
      
          private static final SharedDynamicFilter SHARED_DYNAMIC_FILTER = new SharedDynamicFilter();
      
          @Override
          public void configure(ResourceInfo resourceInfo, Configurable configurable) {
              configurable.register(SHARED_DYNAMIC_FILTER);
          }
      } 
      

      However, when we use a instance per resource, it's considered as expected :

       @Provider
      public class DynamicFilterBinder implements DynamicFeature {
      
          @Override
          public void configure(ResourceInfo resourceInfo, Configurable configurable) {
              configurable.register(new NotSharedDynamicFilter());
          }
      }
      

      Please find attached, a sample project with some ITs showing the problem.

      Attachments

        1. cxf-shared-dynamic-filter.zip
          10 kB
          Fabien Thouny
        2. cxf-shared-dynamic-filter-3.0.0-SNAPSHOT.zip
          8 kB
          Fabien Thouny

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            fabien.thouny Fabien Thouny
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: