Module io.inverno.mod.http.server
Package io.inverno.mod.http.server
Interface Exchange<A extends ExchangeContext>
- Type Parameters:
A- the type of the exchange context
- All Known Subinterfaces:
ErrorExchange<A>
public interface Exchange<A extends ExchangeContext>
Represents a server exchange between a client and a server.
The HTTP server attaches an exchange context created using
RootExchangeHandler.createContext() when an exchange is created.
- Since:
- 1.0
- Author:
- Jeremy Kuhn
- See Also:
-
Method Summary
-
Method Details
-
request
Request request()Returns the request part of the exchange.
- Returns:
- the request part
-
response
Response response()Returns the response part of the exchange.
- Returns:
- the response part
-
context
A context()Returns the context attached to the exchange.
- Returns:
- the exchange context or null
-
finalizer
Adds a finalizer to the exchange which completes once the exchange is fully processed.
A exchange is considered fully processed when the last chunk of the response has been fully sent to the client or following an error.
Note that using a finalizer actually impacts HTTP pipelining since the server wait for the response to be fully sent to the client before processing following requests.
- Parameters:
finalizer- a finalizer- Returns:
- the exchange
-