8.2.5 Spring 3.0 New annotations
@DependsOn @Lazy
@DependsOn: Used to force the initialization of other beans. Modifies the Bean class or method, you can specify a string array as the parameter, and each array element corresponds to a bean that is forced to initialize.
Package Edu.pri.lime._8_2_5.bean; Import org.springframework.context.annotation.DependsOn; Import org.springframework.stereotype.Component; @DependsOn ({"steelaxe", "Lime"}) // specifies that steelaxe, lime two beans will be forced to initialize before the Chinese bean is initialized @Component Public class Chinese {}
@Lazy: Used to specify whether the bean cancels pre-initialization.
Package Edu.pri.lime._8_2_5.bean; Import Org.springframework.context.annotation.Lazy; Import org.springframework.stereotype.Component; @Lazy (true) // The decorated spring Bean class is used to specify the pre-initialization behavior of this Ben, specifying a Boolean value property that determines whether to pre-initialize the bean @Component Public class French {}
La La la
8--deep use of spring--2...5 Spring 3.0 new annotations