Top Description Fields Constructors Methods
org.springframework.http.server.reactive

public Class ContextPathCompositeHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
org.springframework.http.server.reactive.HttpHandler
Imports
java.util.LinkedHashMap, .Map, reactor.core.publisher.Mono, org.springframework.http.HttpStatus, org.springframework.util.Assert

HttpHandler delegating requests to one of several HttpHandler's based on simple, prefix-based mappings.

This is intended as a coarse-grained mechanism for delegating requests to one of several applications -- each represented by an HttpHandler, with the application "context path" (the prefix-based mapping) exposed via ServerHttpRequest#getPath().

Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final Map<String, HttpHandler>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
public Mono<Void>
handle(ServerHttpRequest
current request
request
,
ServerHttpResponse
current response
response
)

Implements org.springframework.http.server.reactive.HttpHandler.handle.

Handle the given request and write to the response.

private static Map<String, HttpHandler>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlerMapback to summary
private final Map<String, HttpHandler> handlerMap

Constructor Detail

ContextPathCompositeHandlerback to summary
public ContextPathCompositeHandler(Map<String, ? extends HttpHandler> handlerMap)

Method Detail

assertValidContextPathback to summary
private static void assertValidContextPath(String contextPath)
handleback to summary
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response)

Implements org.springframework.http.server.reactive.HttpHandler.handle.

Doc from org.springframework.http.server.reactive.HttpHandler.handle.

Handle the given request and write to the response.

Parameters
request:ServerHttpRequest

current request

response:ServerHttpResponse

current response

Returns:Mono<Void>

indicates completion of request handling

Annotations
@Override
initHandlersback to summary
private static Map<String, HttpHandler> initHandlers(Map<String, ? extends HttpHandler> map)