Top Description Constructors Methods
org.springframework.web.reactive.result

public Class SimpleHandlerAdapter

extends Object
implements HandlerAdapter
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.HandlerAdapter
Imports
reactor.core.publisher.Mono, org.springframework.web.reactive.DispatcherHandler, .HandlerAdapter, .HandlerResult, org.springframework.web.server.ServerWebExchange, .WebHandler

HandlerAdapter that allows using the plain WebHandler contract with the generic DispatcherHandler.
Authors
Rossen Stoyanchev, Sebastien Deleuze
Since
5.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Mono<HandlerResult>
handle(ServerWebExchange
current server exchange
exchange
,
Object
the selected handler which must have been previously checked via supports(Object)
handler
)

Implements org.springframework.web.reactive.HandlerAdapter.handle.

Handle the request with the given handler, previously checked via supports(Object).

public boolean
supports(Object
the handler object to check
handler
)

Implements org.springframework.web.reactive.HandlerAdapter.supports.

Whether this HandlerAdapter supports the given handler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

SimpleHandlerAdapterback to summary
public SimpleHandlerAdapter()

Method Detail

handleback to summary
public Mono<HandlerResult> handle(ServerWebExchange exchange, Object handler)

Implements org.springframework.web.reactive.HandlerAdapter.handle.

Doc from org.springframework.web.reactive.HandlerAdapter.handle.

Handle the request with the given handler, previously checked via supports(Object).

Implementations should consider the following for exception handling:

  • Handle invocation exceptions within this method.
  • Set an exception handler on the returned HandlerResult 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.
Parameters
exchange:ServerWebExchange

current server exchange

handler:Object

the selected handler which must have been previously checked via supports(Object)

Returns:Mono<HandlerResult>

Mono that emits a HandlerResult, or completes empty if the request is fully handled; any error signal would not be handled within the DispatcherHandler, and would instead be processed by the chain of registered org.springframework.web.server.WebExceptionHandlers at the end of the org.springframework.web.server.WebFilter chain

Annotations
@Override
supportsback to summary
public boolean supports(Object handler)

Implements org.springframework.web.reactive.HandlerAdapter.supports.

Doc from org.springframework.web.reactive.HandlerAdapter.supports.

Whether this HandlerAdapter supports the given handler.

Parameters
handler:Object

the handler object to check

Returns:boolean

whether the handler is supported

Annotations
@Override