Class 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.
    Rossen Stoyanchev, Juergen Hoeller
    • Constructor Detail

      • InvocableHandlerMethod

        public InvocableHandlerMethod(HandlerMethod handlerMethod)
      • InvocableHandlerMethod

        public InvocableHandlerMethod(java.lang.Object bean,
                                      java.lang.reflect.Method method)
    • Method Detail

      • setArgumentResolvers

        public void setArgumentResolvers(java.util.List<HandlerMethodArgumentResolver> resolvers)
        Configure the argument resolvers to use to use for resolving method argument values against a ServerWebExchange.
      • 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 registry. This is needed for cases where the response is fully handled within the controller in combination with an async void return value.

        By default this is an instance of ReactiveAdapterRegistry with default settings.

        registry - the registry to use
      • invoke

        public reactor.core.publisher.Mono<HandlerResult> invoke(ServerWebExchange exchange,
                                                                 BindingContext bindingContext,
                                                                 java.lang.Object... providedArgs)
        Invoke the method for the given exchange.
        exchange - the current exchange
        bindingContext - the binding context to use
        providedArgs - optional list of argument values to match by type
        a Mono with a HandlerResult.