Top Description Fields Constructors Methods
org.springframework.web.reactive.function.server.support

public Class HandlerFunctionAdapter

extends Object
implements HandlerAdapter
Class Inheritance
All Implemented Interfaces
org.springframework.web.reactive.HandlerAdapter
Imports
java.lang.reflect.Method, reactor.core.publisher.Mono, org.springframework.core.MethodParameter, org.springframework.web.reactive.HandlerAdapter, .HandlerResult, org.springframework.web.reactive.function.server.HandlerFunction, .RouterFunctions, .ServerRequest, org.springframework.web.server.ServerWebExchange

HandlerAdapter implementation that supports HandlerFunctions.
Author
Arjen Poutsma
Since
5.0

Field Summary

Modifier and TypeField and Description
private static final MethodParameter

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

Field Detail

HANDLER_FUNCTION_RETURN_TYPEback to summary
private static final MethodParameter HANDLER_FUNCTION_RETURN_TYPE

Constructor Detail

HandlerFunctionAdapterback to summary
public HandlerFunctionAdapter()

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