Example usage for org.springframework.beans.factory.annotation AnnotatedBeanDefinition setLazyInit

List of usage examples for org.springframework.beans.factory.annotation AnnotatedBeanDefinition setLazyInit

Introduction

In this page you can find the example usage for org.springframework.beans.factory.annotation AnnotatedBeanDefinition setLazyInit.

Prototype

void setLazyInit(boolean lazyInit);

Source Link

Document

Set whether this bean should be lazily initialized.

Usage

From source file:org.rosenvold.spring.convention.ConventionBeanFactory.java

static void processCommonDefinitionAnnotations(AnnotatedBeanDefinition abd) {
    if (abd.getMetadata().isAnnotated(Primary.class.getName())) {
        abd.setPrimary(true);// www  .  j  a  v a2  s. c  om
    }
    if (abd.getMetadata().isAnnotated(Lazy.class.getName())) {
        Boolean value = (Boolean) abd.getMetadata().getAnnotationAttributes(Lazy.class.getName()).get("value");
        abd.setLazyInit(value);
    }
    if (abd.getMetadata().isAnnotated(DependsOn.class.getName())) {
        String[] value = (String[]) abd.getMetadata().getAnnotationAttributes(DependsOn.class.getName())
                .get("value");
        abd.setDependsOn(value);
    }
}