Interface RootExchangeHandler<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 Superinterfaces:
ExchangeHandler<A,B>, ReactiveExchangeHandler<A,B>

public interface RootExchangeHandler<A extends ExchangeContext,B extends Exchange<A>> extends ExchangeHandler<A,B>

A root exchange handler must be provided to the server to handle exchanges.

The HTTP server relies on a root exchange handler to actually process a client request and provide a response to the client. It will create an ErrorExchange and invoke the ErrorExchangeHandler in case an error is thrown during that process.

The HTTP server shall only rely on the ExchangeHandler.defer(Exchange) method in order to remain reactive, the root exchange handler only extends ExchangeHandler to facilitate the definition of the handler using lambda.

It differs from a regular ExchangeHandler by the definition of the createContext() method which is used by the server to create the exchange context associated to an Exchange.

Since:
1.33
Author:
Jeremy Kuhn
  • Method Summary

    Modifier and Type
    Method
    Description
    default A
    Creates an exchange context eventually attached to an exchange.

    Methods inherited from interface io.inverno.mod.http.server.ExchangeHandler

    defer, handle

    Methods inherited from interface io.inverno.mod.http.server.ReactiveExchangeHandler

    intercept
  • Method Details

    • createContext

      default A createContext()

      Creates an exchange context eventually attached to an exchange.

      This method returns null by default.

      Returns:
      a new context instance or null