Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0
    • Component/s: None
    • Labels:
      None

      Description

      (Email from Bill Burke, http://java.net/projects/jax-rs-spec/lists/jsr339-experts/archive/2011-03/message/9)

      In resteasy, we found that Filters and CDI were not good enough for our needs of interception. We wanted to be able to trigger interceptions of the HTTP request at different points depending on what annotations were applied to a JAX-RS method.

      • We couldn't use Filter in many situations because there's no way to trigger/bind a Filter based on an annotation specified on a JAX-RS method.
      • I don't know if Servlet 3.0 fixed this, but originally, Filters didn't work with Async HTTP. Resteasy has Async HTTP integration of its own that we hope to standardize.
      • We couldn't use CDI because we needed different types of interception points were needed: Before the method was called or even matched (security). Or specific to (un)marshalling (wrapping MessageBodyReader/Writer invocations).
      • We wanted something that could be re-used on the client side.

      So, we defined 4 interception points:

      • Pre-process before matching
      • Around MessageBodyReader
      • Around MessageBodyWriter
      • After method was called before marshalling (not sure if we ever had a usecase for this)

      MessageBodyReader/Writer interception was used for things like: gzip encoding, digital signatures, caching. Many of these worked on both the client and server side.

      pre-process interception was used for: caching, security plugins.

        Issue Links

          Activity

          Show
          Santiago Pericas-Geertsen added a comment - See http://java.net/projects/jax-rs-spec/pages/InterceptorsAndFilters
          Hide
          Santiago Pericas-Geertsen added a comment -

          Chapter 6 of Early Draft defines the JAX-RS handler model. The term "handler" was preferred over "interceptor" since the semantics of the former are bit different than the latter.

          Show
          Santiago Pericas-Geertsen added a comment - Chapter 6 of Early Draft defines the JAX-RS handler model. The term "handler" was preferred over "interceptor" since the semantics of the former are bit different than the latter.

            People

            • Assignee:
              Santiago Pericas-Geertsen
              Reporter:
              robc
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: