Class SyncInvocableHandlerMethod
java.lang.Object
org.springframework.web.method.HandlerMethod
org.springframework.web.reactive.result.method.SyncInvocableHandlerMethod
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
HandlerMethod.HandlerMethodParameter
-
Field Summary
Fields inherited from class org.springframework.web.method.HandlerMethod
logger
-
Constructor Summary
ConstructorDescriptionSyncInvocableHandlerMethod
(Object bean, Method method) SyncInvocableHandlerMethod
(HandlerMethod handlerMethod) -
Method Summary
Modifier and TypeMethodDescriptionReturn the configured parameter name discoverer.Return the configured argument resolvers.invokeForHandlerResult
(ServerWebExchange exchange, BindingContext bindingContext, Object... providedArgs) Invoke the method for the given exchange.void
Configure the argument resolvers to use to use for resolving method argument values against aServerWebExchange
.void
setParameterNameDiscoverer
(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
-
Constructor Details
-
SyncInvocableHandlerMethod
-
SyncInvocableHandlerMethod
-
-
Method Details
-
setArgumentResolvers
Configure the argument resolvers to use to use for resolving method argument values against aServerWebExchange
. -
getResolvers
Return the configured argument resolvers. -
setParameterNameDiscoverer
Set the ParameterNameDiscoverer for resolving parameter names when needed (e.g. default request attribute name).Default is a
DefaultParameterNameDiscoverer
. -
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 exchangebindingContext
- the binding context to useprovidedArgs
- 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
-