Skip to content

Support for Supplier as a deferred bean creation [SPR-16973] #21511

Closed
@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-16973 and commented

It's nice that Spring supports this kind of idiom for lazy initialization of Bar:

 

 @Bean
 public Foo foo(Provider<Bar> bar) {
    return new Foo(bar);
 }

 @Bean
 @Lazy
 public Bar bar() {
    return new Bar("bar");
 }

 

It would be nice if it supported Supplier in place of Provider especially now that Java 8 is the baseline.


Affects: 5.0.7

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions