Skip to content

Support @Bean method visibility [SPR-7170] #11829

Closed
@spring-projects-issues

Description

@spring-projects-issues

Eberhard Wolff opened SPR-7170 and commented

In JavaConfig beans created by protected methods with @Bean annotation had visibility inside the @Configuration class only but were not exported into the global ApplicationContext and therefore cannot be referenced from there or other @Configuration annotated classes:

@Configuration
public class MyConfiguration {
  @Bean
  public ABean globallyVisible() { ... }

  @Bean
  protected ABean visibleOnlyInThisClass() { ... }
}

This is great to structure large configuration because beans can be hidden. Bring that feature back please.


Affects: 3.0 GA, 3.0.1, 3.0.2

Issue Links:

27 votes, 22 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    has: votes-jiraIssues migrated from JIRA with more than 10 votes at the time of importin: coreIssues in core modules (aop, beans, core, context, expression)status: bulk-closedAn outdated, unresolved issue that's closed in bulk as part of a cleaning process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions