Skip to content

Support multiple SpringFactoriesLoader files #28416

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

Closed
philwebb opened this issue May 5, 2022 · 0 comments
Closed

Support multiple SpringFactoriesLoader files #28416

philwebb opened this issue May 5, 2022 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

philwebb commented May 5, 2022

For AOT we'd like to be able to load a META-INF/spring/aot.factories files rather than META-INF/spring.factories.

@philwebb philwebb added the type: enhancement A general enhancement label May 5, 2022
@philwebb philwebb added this to the 6.0.0-M4 milestone May 5, 2022
@philwebb philwebb self-assigned this May 5, 2022
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label May 5, 2022
philwebb added a commit to philwebb/spring-framework that referenced this issue May 5, 2022
Update `SpringFactoriesLoader` so that it can load files from
arbitrary locations. An instance of the loader class itself is now
returned from static factory methods that accept different
locations.

The recent `ArgumentResolver` and `FailureHandler` `loadFactories`
variants are now no longer available as static methods. They are
still available as instance methods.

The `loadFactories` static method remains to provide
back-compatibility with Spring Framework 5.x

See spring-projectsgh-28416
philwebb added a commit that referenced this issue May 11, 2022
Update `SpringFactoriesLoader` so that `null` is never used for the
cache key. Prior to this commit, calling `forDefaultResourceLocation`
with `null` and `ClassUtils.getDefaultClassLoader()` would provide
different `SpringFactoriesLoader` instances rather than making use
of a single shared cached instance.

See gh-28416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants