Example usage for org.springframework.context.annotation AnnotatedBeanDefinitionReader registerBean

List of usage examples for org.springframework.context.annotation AnnotatedBeanDefinitionReader registerBean

Introduction

In this page you can find the example usage for org.springframework.context.annotation AnnotatedBeanDefinitionReader registerBean.

Prototype

public <T> void registerBean(Class<T> annotatedClass, @Nullable String name, @Nullable Supplier<T> supplier) 

Source Link

Document

Register a bean from the given bean class, deriving its metadata from class-declared annotations, using the given supplier for obtaining a new instance (possibly declared as a lambda expression or method reference).

Usage

From source file:org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext.java

private void registerBeans(AnnotatedBeanDefinitionReader reader) {
    if (this.logger.isDebugEnabled()) {
        this.logger.debug("Registering supplied beans: ["
                + StringUtils.collectionToCommaDelimitedString(this.registeredBeans) + "]");
    }/*from ww w.  j  a  v  a2s .  c  o  m*/
    this.registeredBeans.forEach(
            (reg) -> reader.registerBean(reg.getAnnotatedClass(), reg.getSupplier(), reg.getQualifiers()));
}