Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-2163

@Provider annotation should work with all client filters

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 4.0.0.Beta7
    • jaxrs
    • None

    Description

      This is a follow up for the issue RESTEASY-2084.

      The JAX-RS specification states that all providers denoted with @Provider annotation should be registered by the JAX-RS runtime. The ClientRequestFilter and ClientResponseFilter have been covered by RESTEASY-2084. However there are more annotations that should be processed for client instances:

      • MessageBodyReader (constrained to client)
      • MessageBodyWriter (constrained to client)
      • AsyncClientResponseProvider
      • ReaderInterceptor (constrained to client)
      • WriterInterceptor (constrained to client)
      • DynamicFeature (constrained to client)

      These providers should be probably also registered with every new client instance. However according to testing done by mkopecky@redhat.com this is not true even for reference implementation Jersey.

      This is potentially breaking change as RESTEasy currently registers provider that can be restricted to client or server and doesn't *use @ContrainedTo annotation to actually constrain its usage to both client *and server. For now for each new client a new provider factory is created and thus loosing all scanned information (client providers can still be registered by service loader). Proposed change would make @Provider annotation work on all clients (as it is intended by the specification) and so may introduce problem if this behavior is not expected.

      Attachments

        Issue Links

          Activity

            People

              mstefank Martin Stefanko
              mstefank Martin Stefanko
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: