Skip to content

Automatically detect and register static nested @FeatureConfiguration classes [SPR-8034] #12689

Closed

Description

@spring-projects-issues

Chris Beams opened SPR-8034 and commented

As a convenience to avoids the need to create a separate compilation unit (.java file) for @FeatureConfiguration types, allow users to do the following:

@Configuration
public class MyBeans {
    @Bean
    public DataSource dataSource() { ... }
    
    @FeatureConfiguration
    static class MyFeatures {
        @Feature
        public ComponentScanSpec scan() {
            return new ComponentScanSpec("com.bank.app");
        }
    }
}

In such a case, no explicit registration or import of the @FeatureConfiguration class would be necessary. Simply bootstrapping the container with

new AnnotationConfigApplicationContext(MyBeans.class);

Would be enough.


Issue Links:

Activity

  1. spring-projects-issues commented on May 7, 2011

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    "Feature" support has been backed out in 3.1 M2. No longer valid.

  2. added
    status: invalid
    type: enhancement
    and removed
    type: enhancement
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalid

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions