public class InvocableHandlerMethod extends HandlerMethod
HandlerMethodArgumentResolver
s.
Use setMessageMethodArgumentResolvers(HandlerMethodArgumentResolver)
to customize the list of argument resolvers.
logger
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.
|
InvocableHandlerMethod(Object bean,
String methodName,
Class<?>... parameterTypes)
Construct a new handler method with the given bean instance, method name and parameters.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
doInvoke(Object... args)
Invoke the handler method with the given argument values.
|
protected String |
getDetailedErrorMessage(String message)
Adds HandlerMethod details such as the controller type and method signature to the given error message.
|
Object |
invoke(Message<?> message,
Object... providedArgs)
Invoke the method with the given message.
|
void |
setMessageMethodArgumentResolvers(HandlerMethodArgumentResolver argumentResolvers)
Set
HandlerMethodArgumentResolver s to use to use for resolving method argument values. |
void |
setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Set the ParameterNameDiscoverer for resolving parameter names when needed
(e.g.
|
createWithResolvedBean, equals, getBean, getBeanType, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getReturnType, getReturnValueType, getShortLogMessage, hashCode, isVoid, toString
public InvocableHandlerMethod(HandlerMethod handlerMethod)
HandlerMethod
.public InvocableHandlerMethod(Object bean, Method method)
public InvocableHandlerMethod(Object bean, String methodName, Class<?>... parameterTypes) throws NoSuchMethodException
bean
- the object beanmethodName
- the method nameparameterTypes
- the method parameter typesNoSuchMethodException
- when the method cannot be foundpublic void setMessageMethodArgumentResolvers(HandlerMethodArgumentResolver argumentResolvers)
HandlerMethodArgumentResolver
s to use to use for resolving method argument values.public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer)
Default is a DefaultParameterNameDiscoverer
.
public Object invoke(Message<?> message, Object... providedArgs) throws Exception
Exception
- raised if no suitable argument resolver can be found,
or the method raised an exceptionprotected String getDetailedErrorMessage(String message)
message
- error message to append the HandlerMethod details to