Interface WebRouteInterceptor<A extends ExchangeContext>

Type Parameters:
A - the exchange context type
All Known Subinterfaces:
WebClient<A>, WebClient.Intercepted<A>

public interface WebRouteInterceptor<A extends ExchangeContext>

Entry point for configuring the Web exchange interceptors to apply when processing Web exchange in an intercepted Web client.

It is implemented by the WebClient. Interceptors are defined using a WebRouteInterceptorManager which allows to specify the criteria a Web exchange to be intercepted by an exchange interceptor.

When defining an interceptor on a Web client, a new intercepted Web client instance shall be created containing the interceptor definition. It can then be used to define more interceptors resulting in the creation of hierarchies of intercepted Web clients with different interceptor definitions with the root Web client at the top.

Web exchanges that are expected to be intercepted must then be processed by the intercepted Web client chain containing the desired interceptor definitions.

Since:
1.12
Author:
Jeremy Kuhn
  • Method Details

    • intercept

      Returns a new interceptor manager for defining a Web route interceptor.

      Returns:
      a new Web route interceptor manager
    • intercept

      default WebRouteInterceptor<A> intercept(Function<WebRouteInterceptorManager<A,? extends WebRouteInterceptor<A>>,? extends WebRouteInterceptor<A>> configurer)

      Configures a Web route interceptor.

      The result returned by the specified configurer function must be the Web route interceptor returned by the input interceptor manager after defining the interceptor and which contains the configured interceptor. If that requirement is not met, invoking this method will most likely result in a no-op operation since the resulting intercepted Web client instance would be lost.

      Parameters:
      configurer - a Web route interceptor configurer function
      Returns:
      the Web route interceptor containing the configured interceptor
    • configureInterceptors

      WebRouteInterceptor<A> configureInterceptors(WebRouteInterceptor.Configurer<? super A> configurer)

      Configures multiple Web route interceptors.

      Parameters:
      configurer - a Web route interceptor configurer
      Returns:
      the Web route interceptor containing the configured interceptors
    • configureInterceptors

      WebRouteInterceptor<A> configureInterceptors(List<WebRouteInterceptor.Configurer<? super A>> configurers)

      Configures multiple Web route interceptors.

      Parameters:
      configurers - a list of Web route interceptor configurers
      Returns:
      the Web route interceptor containing the configured interceptors