Package ch.rasc.wamp2spring.util
Class InvocableHandlerMethod
java.lang.Object
org.springframework.core.annotation.AnnotatedMethod
org.springframework.messaging.handler.HandlerMethod
ch.rasc.wamp2spring.util.InvocableHandlerMethod
public class InvocableHandlerMethod
extends org.springframework.messaging.handler.HandlerMethod
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.core.annotation.AnnotatedMethod
org.springframework.core.annotation.AnnotatedMethod.AnnotatedMethodParameter -
Field Summary
Fields inherited from class org.springframework.messaging.handler.HandlerMethod
defaultLogger, logger -
Constructor Summary
ConstructorsConstructorDescriptionInvocableHandlerMethod(org.springframework.messaging.handler.HandlerMethod handlerMethod) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassertTargetBean(Method method, Object targetBean, Object[] args) Assert that the target bean class is an instance of the class where the given method is declared.Invoke the method after resolving its argument values in the context of the given message.voidsetArgumentResolvers(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite argumentResolvers) voidsetConversionService(org.springframework.core.convert.ConversionService conversionService) voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) voidsetParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer) Methods inherited from class org.springframework.messaging.handler.HandlerMethod
createWithResolvedBean, equals, formatInvokeError, getBean, getBeanType, getContainingClass, getLogger, getResolvedFromHandlerMethod, getShortLogMessage, hashCode, setLoggerMethods inherited from class org.springframework.core.annotation.AnnotatedMethod
findProvidedArgument, formatArgumentError, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getReturnType, getReturnValueType, hasMethodAnnotation, isVoid, toString
-
Constructor Details
-
InvocableHandlerMethod
public InvocableHandlerMethod(org.springframework.messaging.handler.HandlerMethod handlerMethod)
-
-
Method Details
-
setArgumentResolvers
public void setArgumentResolvers(org.springframework.messaging.handler.invocation.HandlerMethodArgumentResolverComposite argumentResolvers) -
setParameterNameDiscoverer
public void setParameterNameDiscoverer(org.springframework.core.ParameterNameDiscoverer parameterNameDiscoverer) -
setConversionService
public void setConversionService(org.springframework.core.convert.ConversionService conversionService) -
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
invoke
@Nullable public Object invoke(WampMessage message, List<Object> arguments, Map<String, Object> argumentsKw) throws ExceptionInvoke the method after resolving its argument values in the context of the given message.Argument values are commonly resolved through
HandlerMethodArgumentResolvers. TheprovidedArgsparameter however may supply argument values to be used directly, i.e. without argument resolution.- Parameters:
message- the current message being processedarguments-argumentsKw-- Returns:
- the raw value returned by the invoked method
- Throws:
Exception- raised if no suitable argument resolver can be found, or if the method raised an exception
-
convert
-
assertTargetBean
Assert that the target bean class is an instance of the class where the given method is declared. In some cases the actual endpoint instance at request- processing time may be a JDK dynamic proxy (lazy initialization, prototype beans, and others). Endpoint classes that require proxying should prefer class-based proxy mechanisms.- Overrides:
assertTargetBeanin classorg.springframework.messaging.handler.HandlerMethod
-