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, previously checked viaHandlerAdapter.supports(Object)
.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, previously checked viaHandlerAdapter.supports(Object)
.Implementations should consider the following for exception handling:
- Handle invocation exceptions within this method.
Set an exception handler
on the returnedHandlerResult
to handle deferred exceptions from asynchronous return values, and to handle exceptions from response rendering.- Implement
DispatchExceptionHandler
to extend exception handling to exceptions that occur before a handler is selected.
- 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 aHandlerResult
, or completes empty if the request is fully handled; any error signal would not be handled within theDispatcherHandler
, and would instead be processed by the chain of registeredWebExceptionHandler
s at the end of theWebFilter
chain
-