public class HttpWebHandlerAdapter extends WebHandlerDecorator implements HttpHandler
WebHandler
to the HttpHandler
contract.
By default creates and configures a DefaultServerWebExchange
and
then invokes the target WebHandler
.
Constructor and Description |
---|
HttpWebHandlerAdapter(WebHandler delegate) |
Modifier and Type | Method and Description |
---|---|
protected ServerWebExchange |
createExchange(ServerHttpRequest request,
ServerHttpResponse response) |
ServerCodecConfigurer |
getCodecConfigurer()
Return the configured
ServerCodecConfigurer . |
LocaleContextResolver |
getLocaleContextResolver()
Return the configured
LocaleContextResolver . |
WebSessionManager |
getSessionManager()
Return the configured
WebSessionManager . |
reactor.core.publisher.Mono<java.lang.Void> |
handle(ServerHttpRequest request,
ServerHttpResponse response)
Handle the given request and write to the response.
|
void |
setCodecConfigurer(ServerCodecConfigurer codecConfigurer)
Configure a custom
ServerCodecConfigurer . |
void |
setLocaleContextResolver(LocaleContextResolver localeContextResolver)
Configure a custom
LocaleContextResolver . |
void |
setSessionManager(WebSessionManager sessionManager)
Configure a custom
WebSessionManager to use for managing web
sessions. |
getDelegate, handle, toString
public HttpWebHandlerAdapter(WebHandler delegate)
public void setSessionManager(WebSessionManager sessionManager)
WebSessionManager
to use for managing web
sessions. The provided instance is set on each created
DefaultServerWebExchange
.
By default this is set to DefaultWebSessionManager
.
sessionManager
- the session manager to usepublic WebSessionManager getSessionManager()
WebSessionManager
.public void setCodecConfigurer(ServerCodecConfigurer codecConfigurer)
ServerCodecConfigurer
. The provided instance is set on
each created DefaultServerWebExchange
.
By default this is set to ServerCodecConfigurer.create()
.
codecConfigurer
- the codec configurer to usepublic void setLocaleContextResolver(LocaleContextResolver localeContextResolver)
LocaleContextResolver
. The provided instance is set on
each created DefaultServerWebExchange
.
By default this is set to
AcceptHeaderLocaleContextResolver
.
localeContextResolver
- the locale context resolver to usepublic ServerCodecConfigurer getCodecConfigurer()
ServerCodecConfigurer
.public LocaleContextResolver getLocaleContextResolver()
LocaleContextResolver
.public reactor.core.publisher.Mono<java.lang.Void> handle(ServerHttpRequest request, ServerHttpResponse response)
HttpHandler
handle
in interface HttpHandler
request
- current requestresponse
- current responseprotected ServerWebExchange createExchange(ServerHttpRequest request, ServerHttpResponse response)