spring-framework / org.springframework.web.reactive / HandlerAdapter

HandlerAdapter

interface HandlerAdapter

Contract that decouples the DispatcherHandler from the details of invoking a handler and makes it possible to support any handler type.

Author
Rossen Stoyanchev

Author
Sebastien Deleuze

Since
5.0

Functions

handle

abstract fun handle(exchange: ServerWebExchange, handler: Any): Mono<HandlerResult>

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 to set an exception on the HandlerResult so that may also be applied later after result handling.

supports

abstract fun supports(handler: Any): Boolean

Whether this HandlerAdapter supports the given handler.

Inheritors

WebSocketHandlerAdapter

open class WebSocketHandlerAdapter : HandlerAdapter

HandlerAdapter that allows using a WebSocketHandler with the generic DispatcherHandler mapping URLs directly to such handlers. Requests are handled by delegating to the configured WebSocketService which by default is HandshakeWebSocketService.