List of usage examples for org.springframework.messaging.handler HandlerMethod HandlerMethod
public HandlerMethod(String beanName, BeanFactory beanFactory, Method method)
From source file:org.springframework.messaging.handler.invocation.AbstractMethodMessageHandler.java
/** * Create a HandlerMethod instance from an Object handler that is either a handler * instance or a String-based bean name. */// w w w . jav a 2 s . co m protected HandlerMethod createHandlerMethod(Object handler, Method method) { HandlerMethod handlerMethod; if (handler instanceof String) { ApplicationContext context = getApplicationContext(); Assert.state(context != null, "ApplicationContext is required for resolving handler bean names"); String beanName = (String) handler; handlerMethod = new HandlerMethod(beanName, context.getAutowireCapableBeanFactory(), method); } else { handlerMethod = new HandlerMethod(handler, method); } return handlerMethod; }
From source file:org.springframework.messaging.handler.invocation.reactive.AbstractMethodMessageHandler.java
/** * Create a HandlerMethod instance from an Object handler that is either a handler * instance or a String-based bean name. *//*www . ja v a 2s . co m*/ private HandlerMethod createHandlerMethod(Object handler, Method method) { HandlerMethod handlerMethod; if (handler instanceof String) { ApplicationContext context = getApplicationContext(); Assert.state(context != null, "ApplicationContext is required for resolving handler bean names"); String beanName = (String) handler; handlerMethod = new HandlerMethod(beanName, context.getAutowireCapableBeanFactory(), method); } else { handlerMethod = new HandlerMethod(handler, method); } return handlerMethod; }