Search

28.4. ClientExecutionInterceptors

download PDF
org.jboss.resteasy.spi.interception.ClientExecutionInterceptor classes are client-side only. They run after the MessageBodyWriter, and after the ClientRequest has been built on the client side. They wrap the HTTP invocation that is sent to the server. In RESTEasy GZIP support, they set the Accept header to contain gzip, deflate before the request is sent. In the RESTEasy client cache, they check that the cache contains a resource before attempting to act on a resource. These interceptors must be annotated with both @ClientInterceptor and @Provider.
    public interface ClientExecutionInterceptor
    {
       ClientResponse execute(ClientExecutionContext ctx) throws Exception;
    }

    public interface ClientExecutionContext
    {
       ClientRequest getRequest();

       ClientResponse proceed() throws Exception;
    }

They work similarly to MessageBodyReader in that you must call proceed() or the invocation will be aborted.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.