Example usage for org.springframework.messaging.handler HandlerMethod HandlerMethod

List of usage examples for org.springframework.messaging.handler HandlerMethod HandlerMethod

Introduction

In this page you can find the example usage for org.springframework.messaging.handler HandlerMethod HandlerMethod.

Prototype

private HandlerMethod(HandlerMethod handlerMethod, Object handler) 

Source Link

Document

Re-create HandlerMethod with the resolved handler.

Usage

From source file:org.springframework.messaging.handler.HandlerMethod.java

/**
 * If the provided instance contains a bean name rather than an object instance,
 * the bean name is resolved before a {@link HandlerMethod} is created and returned.
 *//*from   w  w w.j a v  a2  s  .  c om*/
public HandlerMethod createWithResolvedBean() {
    Object handler = this.bean;
    if (this.bean instanceof String) {
        Assert.state(this.beanFactory != null, "Cannot resolve bean name without BeanFactory");
        String beanName = (String) this.bean;
        handler = this.beanFactory.getBean(beanName);
    }
    return new HandlerMethod(this, handler);
}