-
Notifications
You must be signed in to change notification settings - Fork 682
Introduce common AOT infrastructure. #2624
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
Conversation
/** | ||
* @author Christoph Strobl | ||
*/ | ||
public class TypeUtils { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this class can be moved to org.springframework.data.util.
I don't see anything in this class that is specific to the native AOT processing infrastructure classes in Spring Data (i.e. org.springframework.data.aot).
return types::forEach; | ||
} | ||
|
||
static ManagedTypes o(Supplier<Iterable<? extends Class<?>>> dataProvider) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelled. No matter, I fixed in a polish commit.
}; | ||
|
||
public TypeCollector filterFields(Predicate<Field> filter) { | ||
this.fieldFilter = filter.and(filter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious if you meant to prepend here? I ask because the filterTypes(:Predicate) method below "appends".
|
||
static class InspectionCache { | ||
|
||
private final Map<String, ResolvableType> mutableCache = new LinkedHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a WeakHashMap?
2c4e594
to
5dd1edc
Compare
df1cfca
to
175ed04
Compare
c08d207
to
2a1a8f3
Compare
80cea59
to
ecd5f79
Compare
dd7290f
to
1b9e17f
Compare
This commit introduces initial support for framework 6 bases ahead of time processing of data components and adds extension points for module implementations.
Should be dropped on merge!
We provide an initial set of runtime hints required to spin up data repositories on GraalVM native image.
…ections. We now provide PropertiesBasedNamedQueriesFactoryBean to create PropertiesBasedNamedQueries directly bypassing indirections through PropertiesFactoryBean and PropertiesBasedNamedQueries.
…anDefinition(…) to allow additional bean registrations.
This avoids having to touch modules to add something like ImportRuntimeHints(AuditingHints.ReactiveAuditingRuntimeHints.class) to the enabled auditing annotations.
Simplify field and method filter creation. Reformat aot.factories.
Enables reachability analysis. Previously, the presence checks were using method invocations and the AOT processing isn't following the methods.
Improve factory methods. Integrate auditing hints in AuditingBeanRegistrationAotProcessor. Reduce visibility, improve naming.
01b58a3
to
f9033cf
Compare
* Refactored logic in AOT infrastructure classes. * Annotated AOT API with Spring's @nonnull and @nullable annotations. * Edited Javadoc. * Introduced PredicateUtils abstract utility class encapsulating common Predicates on types and class members. * Added comments for review and clarification. Original Pull Request: #2624
We provide an initial set of runtime hints required to spin up data repositories on GraalVM native image. Additionally we skip synthetic types during type inspection. Original Pull Request: #2624
…ections. We now provide PropertiesBasedNamedQueriesFactoryBean to create PropertiesBasedNamedQueries directly bypassing indirections through PropertiesFactoryBean and PropertiesBasedNamedQueries. Original Pull Request: #2624
Original Pull Request: #2624
…anDefinition(…) to allow additional bean registrations. Original Pull Request: #2624
This avoids having to touch modules to add something like ImportRuntimeHints(AuditingHints.ReactiveAuditingRuntimeHints.class) to the enabled auditing annotations. Original Pull Request: #2624
Update javadoc and reformat aot.factories. Original Pull Request: #2624
Enables reachability analysis. Previously, the presence checks were using method invocations and the AOT processing isn't following the methods. Original Pull Request: #2624
Original Pull Request: #2624
Improve factory methods. Integrate auditing hints in AuditingBeanRegistrationAotProcessor. Reduce visibility, improve naming. Original Pull Request: #2624
The commons module hosts the basic infrastructure for contributing data related bits to the AOT processing.
We introduced
ManagedTypes
as an abstraction that allows to define what was up till now defined via theinitialEntitySet
in theMappingContext
.ManagedTypes
may be provided per store module as a regular bean in the application context, if not present a lazy evaluating variant will be registered, picking up types annotated with one of the store specificidentifyingAnnotations
within the repository base packages.This allows store implementations to provide an
AotManagedTypesPostProcessor
picking up the bean to render additional configuration (reflection, proxy,...) for the domain types present.RepositoryConfigurationExtension.getAotPostProcessor()
defines the type of theAotContributingRepositoryBeanPostProcessor
to be used by a store module. By default the variant provided by data commons will contribute proxy/reflection configuration for all types reachable from the repository interface. This includes the domain & id types as well as those returned by repository finder methods identifying potential projection proxies.