Interface ReactiveExchangeHandler<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
All Known Subinterfaces:
ErrorRouter<A,B,C,D,E,F,G,H>, ErrorWebRouter<A>, ExchangeHandler<A,B>, Router<A,B,C,D,E,F,G,H>, WebRouter<A>
All Known Implementing Classes:
FormLoginPageHandler, LoginActionHandler, LogoutActionHandler, StaticHandler
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 ReactiveExchangeHandler<A extends ExchangeContext,B extends Exchange<A>>

A reactive exchange handler is used to handle server exchanges following reactive principles.

Since:
1.0
Author:
Jeremy Kuhn
See Also:
  • Method Details

    • intercept

      default ReactiveExchangeHandler<A,B> intercept(ExchangeInterceptor<A,B> interceptor)

      Returns a composed exchange handler that first applies the interceptor to transform the exchange and then invoke the defer(io.inverno.mod.http.server.Exchange).

      Parameters:
      interceptor - the interceptor
      Returns:
      a composed exchange handler
    • defer

      Mono<Void> defer(B exchange) throws HttpException

      Returns a Mono that defers the processing of the exchange.

      This method is invoked by the HTTP server which then subscribes to the resulting Mono and, on completion, to the exchange response body data publisher to respond to the client.

      Parameters:
      exchange - the exchange to process
      Returns:
      an empty mono that completes when the exchange has been processed
      Throws:
      HttpException - if an error occurs during the processing of the exchange