-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
For Spring AOT to be more flexible, we'd like to record certain contributions without a locked-down BeanFactory. The most typical example is the handling of @Profile where we'd like to process them even though they may or may not be used at runtime.
The two immediate contenders here are: a (as much as possible) complete index for classpath scanning, and the build-time creation of CGLIB proxies.
Two things need to be improved to achieve this goals:
- The
Conditioncontract should be expanded with the notion of AOT processing where a condition can change its behavior based this new processing. Condition evaluation should offer a configurable option where this can be turned on - As additional bean definitions are filled in the
BeanFactorybean names clash are going to be frequent. We should find a way to name those beans so that they can be inspected.
Spring AOT has a strong requirements that the classpath can't be changed. As such, @ConditionalOnClass (or any classpath-based condition) should opt-out of this new mechanism and always provide the same outcome. This will make sure we won't get a BeanDefinition in the bean factory for something that would obviously break if we tried to investigate its type.