I am using Spring annotation @Componentto configure many of the beans in my Spring 3.0 application. I would like to know if it's possible to create some of these beans lazily - especially prototypebeans?
@Component
prototype
To declare a lazy initialized bean, you can use annotation @Lazy.
@Lazy
Note, however, that this does not make sense for prototypebeans - they cannot be impatiently initialized, so there is no need to mark them lazy.
beans . beans , - , .