Skip to content

Add a way to register the need for runtime reflection, resources, proxying, and serialization on components #27829

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
snicoll opened this issue Dec 16, 2021 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented Dec 16, 2021

Spring Native has a component called NativeConfigurationRegistry that offers a programmatic API to register the need for reflection, resources that are to be shipped in the native image, proxies as well as classes that should be Serializable.

We'd like to revisit this contract and make less native specific as we believe that such information could be useful elsewhere.

Such an infrastructure could land in spring-core as it is rather high-level and focused on classes and resources. The actual processing of the registry, for instance, to write GraalVM-specific configuration files is not in the scope of this issue.

@snicoll snicoll added type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Dec 16, 2021
@snicoll snicoll added this to the 6.0.0-M3 milestone Dec 16, 2021
@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label Dec 16, 2021
@snicoll snicoll self-assigned this Jan 6, 2022
snicoll added a commit to snicoll/spring-framework that referenced this issue Jan 6, 2022
This commit provides an API to record the need for reflection,
resources, serialization, and proxies at runtime. It offers a central
`RuntimeHints` facility that can record various aspects.

For reflection, individual elements of a type can be recorded, as well
as a predefined categories (identified by the `MemberCategory` enum). A
method or constructor hint can refine whether the need to execute it is
required.

For resources, they can be included using includes/excludes pattern that
can either:

* An exact match: `com/example/test.properties`
* A pattern, using `*` or `?` to include multiple resources, such as
`com/example/*.properties`
* A regular expression

Resource bundles can be added as well by providing its basename.

// TODO serialization - proxy

Closes spring-projectsgh-27829
snicoll added a commit that referenced this issue Feb 7, 2022
snicoll added a commit that referenced this issue Feb 7, 2022
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) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants