New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationalize naming strategy in ApplicationContextAotGenerator #28585
Comments
Another example is the |
We've discussed passing the snicoll@88428ed is an attempt at making the naming strategy a separate, third argument. In short Experimenting with this reveals several interesting things:
This works relatively nicely up to a point where we need to process another context as part of processing the context of the application. When this happens, the only reliable callback we have is
Spring Native had a |
I also believe that tightening this will help us remove the AOT package name ( |
Another thing to note is that the "name" uniqueness is not enforced upfront. If you try to generate multiple contexts with the name This goes in the direction again of the context being in charge of the registered names and their uniqueness. Unfortunately |
ApplicationContextAotGenerator
uses aGenerationContext
to analyze anApplicationContext
. The generation context provides the necessary infrastructure to generate "files" (i.e. source code and resources). It's part ofspring-core
.As part of this analysis, an
ApplicationContextInitializer
is generated and serves as the entry point for running an optimized version of the specifiedApplicationContext
at runtime. Additional files may be generated and needs extra help in terms of naming conventions.The current API has a
ClassName
for theApplicationContextInitializer
as well as a targetClass
and aname
for naming conventions purposes. I think that, at the very least, we should gather these in some sort of naming conventions strategy. Because we need to get a reference to the initializer classname, we could return something rather thanvoid
.There is the use case that
ApplicationContextGenerator
is called for dedicated contexts (such as the management context in Spring Boot). In this case we want to pass along theGenerationContext
so that it records all resources/files in a single place and an updated naming strategy.The text was updated successfully, but these errors were encountered: