Class SimpleHandlerAdapter
java.lang.Object
org.springframework.web.reactive.result.SimpleHandlerAdapter
- All Implemented Interfaces:
HandlerAdapter
- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Sebastien Deleuze
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<HandlerResult>
handle
(ServerWebExchange exchange, Object handler) Handle the request with the given handler.boolean
Whether thisHandlerAdapter
supports the givenhandler
.
-
Constructor Details
-
SimpleHandlerAdapter
public SimpleHandlerAdapter()
-
-
Method Details
-
supports
Description copied from interface:HandlerAdapter
Whether thisHandlerAdapter
supports the givenhandler
.- Specified by:
supports
in interfaceHandlerAdapter
- Parameters:
handler
- the handler object to check- Returns:
- whether the handler is supported
-
handle
public reactor.core.publisher.Mono<HandlerResult> handle(ServerWebExchange exchange, Object handler) Description copied from interface:HandlerAdapter
Handle the request with the given handler.Implementations are encouraged to handle exceptions resulting from the invocation of a handler in order and if necessary to return an alternate result that represents an error response.
Furthermore since an async
HandlerResult
may produce an error later during result handling implementations are also encouraged toset an exception handler
on theHandlerResult
so that may also be applied later after result handling.- Specified by:
handle
in interfaceHandlerAdapter
- Parameters:
exchange
- current server exchangehandler
- the selected handler which must have been previously checked viaHandlerAdapter.supports(Object)
- Returns:
Mono
that emits a singleHandlerResult
or none if the request has been fully handled and doesn't require further handling.
-