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

public Class SyncInvocableHandlerMethod

extends HandlerMethod
Class Inheritance
Imports
java.lang.reflect.Method, java.util.List, java.util.concurrent.CompletableFuture, .ExecutionException, org.springframework.core.DefaultParameterNameDiscoverer, .ParameterNameDiscoverer, org.springframework.lang.Nullable, org.springframework.web.method.HandlerMethod, org.springframework.web.reactive.BindingContext, .HandlerResult, org.springframework.web.server.ServerErrorException, .ServerWebExchange

Extension of HandlerMethod that invokes the underlying method via InvocableHandlerMethod but uses sync argument resolvers only and thus can return directly a HandlerResult with no async wrappers.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final InvocableHandlerMethod
Inherited from org.springframework.web.method.HandlerMethod:
logger

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public ParameterNameDiscoverer
getParameterNameDiscoverer()

Return the configured parameter name discoverer.

public List<SyncHandlerMethodArgumentResolver>
getResolvers()

Return the configured argument resolvers.

public HandlerResult

Returns:

a Mono with a HandlerResult.
invokeForHandlerResult
(ServerWebExchange
the current exchange
exchange
,
BindingContext
the binding context to use
bindingContext
,
Object...
optional list of argument values to match by type
providedArgs
)

Invoke the method for the given exchange.

public void
setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers)

Configure the argument resolvers to use for resolving method argument values against a ServerWebExchange.

public void
setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)

Set the ParameterNameDiscoverer for resolving parameter names when needed (e.g. default request attribute name).

Inherited from org.springframework.web.method.HandlerMethod:
assertTargetBeancreateWithResolvedBeancreateWithValidateFlagsequalsformatInvokeErrorgetBeangetBeanTypegetContainingClassgetResolvedFromHandlerMethodgetResponseStatusgetResponseStatusReasongetShortLogMessagehashCodeshouldValidateArgumentsshouldValidateReturnValuetoString

Field Detail

delegateback to summary
private final InvocableHandlerMethod delegate

Constructor Detail

SyncInvocableHandlerMethodback to summary
public SyncInvocableHandlerMethod(HandlerMethod handlerMethod)
SyncInvocableHandlerMethodback to summary
public SyncInvocableHandlerMethod(Object bean, Method method)

Method Detail

getParameterNameDiscovererback to summary
public ParameterNameDiscoverer getParameterNameDiscoverer()

Return the configured parameter name discoverer.

getResolversback to summary
public List<SyncHandlerMethodArgumentResolver> getResolvers()

Return the configured argument resolvers.

invokeForHandlerResultback to summary
public HandlerResult invokeForHandlerResult(ServerWebExchange exchange, BindingContext bindingContext, Object... providedArgs)

Invoke the method for the given exchange.

Parameters
exchange:ServerWebExchange

the current exchange

bindingContext:BindingContext

the binding context to use

providedArgs:Object[]

optional list of argument values to match by type

Returns:HandlerResult

a Mono with a HandlerResult.

Annotations
@Nullable
Exceptions
ServerErrorException:
if method argument resolution or method invocation fails
setArgumentResolversback to summary
public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers)

Configure the argument resolvers to use for resolving method argument values against a ServerWebExchange.

setParameterNameDiscovererback to summary
public void setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)

Set the ParameterNameDiscoverer for resolving parameter names when needed (e.g. default request attribute name).

Default is a DefaultParameterNameDiscoverer.