Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Reduce the need for reflection by using functional configurationΒ #386

Closed

Description

@sdeleuze

Leveraging @dsyer work on https://github.com/spring-projects-experimental/spring-init. The scope is not to be 100% reflection-less but rather to limit the amount of reflection to lower the footprint and increase the compatibility. Reflection will typically remain for @Controller etc.

Activity

  1. added this to the 0.9.1 milestone on Nov 25, 2020
  2. sdeleuze commented on Jan 28, 2021

    @sdeleuze
    ContributorAuthor
  3. modified the milestones: 0.9.1, 0.9.2 on Feb 26, 2021
  4. SentryMan commented on Mar 31, 2021

    @SentryMan

    So I'm a bit confused, will Spring-Init be merged with the AOT Plugin, or remain separate? I notice it hasn't been updated in a while.

  5. dsyer commented on Mar 31, 2021

    @dsyer
    Contributor

    Many of the ideas in Spring Init have been incorporated into the AOT plugin. It's not clear that Spring Init is adding very much at this point, so I suppose the answer is "we don't know". It might be slightly faster in a regular JVM still, but that's without doing much optimization of the AOT generated code. If you are actually using Spring Init and would like to provide feedback, no decision has been made, so go ahead.

  6. sdeleuze commented on Jul 20, 2021

    @sdeleuze
    ContributorAuthor

    The first bits have been introduced in https://github.com/spring-projects-experimental/spring-native/tree/0.11.x with the AOT generation of a ContextBootstrap which looks like that:

    public class ContextBootstrap implements ApplicationContextInitializer<GenericApplicationContext> {
      public void initialize(GenericApplicationContext context) {
        context.registerBean("commandlinerunnerApplication", CommandlinerunnerApplication.class, CommandlinerunnerApplication::new);
        context.registerBean("CLR", CLR.class, CLR::new);
        org.springframework.boot.autoconfigure.ContextBootstrap.registerBasePackages(context);
        context.registerBean("org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration", PropertyPlaceholderAutoConfiguration.class, PropertyPlaceholderAutoConfiguration::new);
        context.registerBean("propertySourcesPlaceholderConfigurer", PropertySourcesPlaceholderConfigurer.class, () -> PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer());
        org.springframework.boot.autoconfigure.aop.ContextBootstrap.registerClassProxyingConfiguration(context);
        org.springframework.boot.autoconfigure.aop.ContextBootstrap.registerForceAutoProxyCreatorToUseClassProxying(context);
        context.registerBean("org.springframework.boot.autoconfigure.aop.AopAutoConfiguration", AopAutoConfiguration.class, AopAutoConfiguration::new);
        // ...
      }
    }
    

    I will create more fine grained issues to track our progresses.

  7. sdeleuze commented on Jul 26, 2021

    @sdeleuze
    ContributorAuthor

    Let's close this one as the base mechanism is now used and continue with more 0.11 fine grained issues as we migrate other samples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions