org.springframework.messaging.handler.invocation.reactive

## Class InvocableHandlerMethod

- java.lang.Object
- - org.springframework.messaging.handler.HandlerMethod
  - - org.springframework.messaging.handler.invocation.reactive.InvocableHandlerMethod

-     public class InvocableHandlerMethod
      extends HandlerMethod

  Extension of `HandlerMethod` that invokes the underlying method with argument values resolved from the current HTTP request through a list of `HandlerMethodArgumentResolver`.
  Since:
    5.2
  Author:
    Rossen Stoyanchev

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.springframework.messaging.handler.HandlerMethod

      `HandlerMethod.HandlerMethodParameter`

  - ### Field Summary

    - ### Fields inherited from class org.springframework.messaging.handler.HandlerMethod

      `defaultLogger, logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `InvocableHandlerMethod(HandlerMethod handlerMethod)` Create an instance from a `HandlerMethod`.
    `InvocableHandlerMethod(Object bean, Method method)` Create an instance from a bean instance and a method.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ParameterNameDiscoverer` | `getParameterNameDiscoverer()` Return the configured parameter name discoverer.
    `List<HandlerMethodArgumentResolver>` | `getResolvers()` Return the configured argument resolvers.
    `reactor.core.publisher.Mono<Object>` | `invoke(Message<?> message, Object... providedArgs)` Invoke the method for the given exchange.
    `void` | `setArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers)` Configure the argument resolvers to use for resolving method argument values against a `ServerWebExchange`.
    `void` | `setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)` Set the ParameterNameDiscoverer for resolving parameter names when needed (e.g.
    `void` | `setReactiveAdapterRegistry(ReactiveAdapterRegistry registry)` Configure a reactive adapter registry.

    - ### Methods inherited from class org.springframework.messaging.handler.HandlerMethod

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

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

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

- - ### Constructor Detail

    - #### InvocableHandlerMethod

          public InvocableHandlerMethod(HandlerMethod handlerMethod)

      Create an instance from a `HandlerMethod`.

    - #### InvocableHandlerMethod

          public InvocableHandlerMethod(Object bean,
                                        Method method)

      Create an instance from a bean instance and a method.

  - ### Method Detail

    - #### setArgumentResolvers

          public void setArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers)

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

    - #### getResolvers

          public List<HandlerMethodArgumentResolver> getResolvers()

      Return the configured argument resolvers.

    - #### setParameterNameDiscoverer

          public void setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)

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

      Default is a `DefaultParameterNameDiscoverer`.

    - #### getParameterNameDiscoverer

          public ParameterNameDiscoverer getParameterNameDiscoverer()

      Return the configured parameter name discoverer.

    - #### setReactiveAdapterRegistry

          public void setReactiveAdapterRegistry(ReactiveAdapterRegistry registry)

      Configure a reactive adapter registry. This is needed for async return values.

      By default this is a `ReactiveAdapterRegistry` with default settings.

    - #### invoke

          public reactor.core.publisher.Mono<Object> invoke(Message<?> message,
                                                            Object... providedArgs)

      Invoke the method for the given exchange.
      Parameters:
        `message` - the current message
        `providedArgs` - optional list of argument values to match by type
      Returns:
        a Mono with the result from the invocation