Interface ExchangeInterceptor<A extends ExchangeContext,B extends Exchange<A>>

Type Parameters:
A - the type of the exchange context
B - the type of exchange handled by the handler
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ExchangeInterceptor<A extends ExchangeContext,B extends Exchange<A>>

An exchange interceptor is used to intercept a server exchange before it is handled by a ExchangeHandler.

Multiple exchange interceptors can be chained on an exchange handler invoking the ReactiveExchangeHandler.intercept(io.inverno.mod.http.server.ExchangeInterceptor) method in order to form an exchange handling chain.

An exchange interceptor can perform some processing or instrument the exchange prior to the actual exchange processing by the exchange handler.

It can also process the exchange and stop the exhange handling chain by returning an empty Mono in which case the exchange handler is not invoked.

Since:
1.3
Author:
Jeremy Kuhn
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    reactor.core.publisher.Mono<? extends B>
    intercept(B exchange)
    Intercepts the exchange before the exchange handler is invoked.
  • Method Details

    • intercept

      reactor.core.publisher.Mono<? extends B> intercept(B exchange)

      Intercepts the exchange before the exchange handler is invoked.

      Parameters:
      exchange - the server exchange to handle
      Returns:
      a Mono emitting the exchange or an instrumented exchange to continue the exchange handling chain or an empty Mono to stop the exchange handling chain