org.springframework.web.reactive.result.method

## Class SyncInvocableHandlerMethod

- java.lang.Object
- - org.springframework.web.method.HandlerMethod
  - - org.springframework.web.reactive.result.method.SyncInvocableHandlerMethod

    public class SyncInvocableHandlerMethod
    extends org.springframework.web.method.HandlerMethod

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.

Since:
  5.0
Author:
  Rossen Stoyanchev

### Nested Class Summary

### Nested classes/interfaces inherited from class org.springframework.web.method.HandlerMethod

`org.springframework.web.method.HandlerMethod.HandlerMethodParameter`

### Field Summary

### Fields inherited from class org.springframework.web.method.HandlerMethod

`logger`

### Constructor Summary

Constructors
Constructor and Description
`SyncInvocableHandlerMethod(org.springframework.web.method.HandlerMethod handlerMethod)`
`SyncInvocableHandlerMethod(Object bean, Method method)`

### Method Summary

All Methods Instance Methods Concrete Methods
`org.springframework.core.ParameterNameDiscoverer` `getParameterNameDiscoverer()` Return the configured parameter name discoverer.
`List<SyncHandlerMethodArgumentResolver>` `getResolvers()` Return the configured argument resolvers.
`HandlerResult` `invokeForHandlerResult(org.springframework.web.server.ServerWebExchange exchange, BindingContext bindingContext, Object... providedArgs)` Invoke the method for the given exchange.
`void` `setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers)` Configure the argument resolvers to use to use for resolving method argument values against a `ServerWebExchange`.
`void` `setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer nameDiscoverer)` Set the ParameterNameDiscoverer for resolving parameter names when needed (e.g.

### Methods inherited from class org.springframework.web.method.HandlerMethod

`assertTargetBean, createWithResolvedBean, equals, findProvidedArgument, formatArgumentError, formatInvokeError, getBean, getBeanType, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getResolvedFromHandlerMethod, getResponseStatus, getResponseStatusReason, getReturnType, getReturnValueType, getShortLogMessage, hashCode, hasMethodAnnotation, isVoid, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### SyncInvocableHandlerMethod

    public SyncInvocableHandlerMethod(org.springframework.web.method.HandlerMethod handlerMethod)

#### SyncInvocableHandlerMethod

    public SyncInvocableHandlerMethod(Object bean,
                                      Method method)

### Method Detail

#### setArgumentResolvers

    public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers)

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

#### getResolvers

    public List<SyncHandlerMethodArgumentResolver> getResolvers()

Return the configured argument resolvers.

#### setParameterNameDiscoverer

    public void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer nameDiscoverer)

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

Default is a `DefaultParameterNameDiscoverer`.

#### getParameterNameDiscoverer

    public org.springframework.core.ParameterNameDiscoverer getParameterNameDiscoverer()

Return the configured parameter name discoverer.

#### invokeForHandlerResult

    @Nullable
    public HandlerResult invokeForHandlerResult(org.springframework.web.server.ServerWebExchange exchange,
                                                          BindingContext bindingContext,
                                                          Object... providedArgs)

Invoke the method for the given exchange.

Parameters:
  `exchange` - the current exchange
  `bindingContext` - the binding context to use
  `providedArgs` - optional list of argument values to match by type
Returns:
  a Mono with a `HandlerResult`.
Throws:
  `org.springframework.web.server.ServerErrorException` - if method argument resolution or method invocation fails