AotFactoriesLoader#load is merging entries from aot.factories and beans from the context. We're still in the process of determining what should or shouldn't be instantiated at build-time but it looks we're in agreement that it should be limited to certain use cases only whereas load does it for any factory type.

Comment From: snicoll

With the recent work on #28833, we have the ability to select if we want to consider beans from the context. At the moment, the following implementations are instantiated at build-time:

  • BeanRegistrationAotProcessor
  • BeanRegistrationExcludeFilter
  • BeanFactoryInitializationAotProcessor

I think BeanRegistrationExcludeFilter is a little odd. I think BeanRegistrationAotProcessor may implement this interface to complement what its contribution is doing. I am not sure that loading any bean that implements this interface represents an actual use case.

As for BeanFactoryInitializationAotProcessor there's no question about it being a good candidate but the lack of boundaries concerns me a bit.

Comment From: philwebb

I wonder if we've got anyone actually using BeanRegistrationExcludeFilter?