Class SyncInvocableHandlerMethod

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

public class SyncInvocableHandlerMethod extends 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
  • Constructor Details

    • SyncInvocableHandlerMethod

      public SyncInvocableHandlerMethod(HandlerMethod handlerMethod)
    • SyncInvocableHandlerMethod

      public SyncInvocableHandlerMethod(Object bean, Method method)
  • Method Details

    • 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(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.
    • invokeForHandlerResult

      @Nullable public HandlerResult invokeForHandlerResult(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:
      ServerErrorException - if method argument resolution or method invocation fails