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

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

Introduction

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

Prototype

void setDependsOn(@Nullable String... dependsOn);

Source Link

Document

Set the names of the beans that this bean depends on being 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);/*w  w  w. j a  v a  2  s. c o m*/
    }
    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);
    }
}