Improve ability to introspect bean context prior to start #10805
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The existing
InitializableBeanContext
is problematic because it still creates context scoped beans and runs event listeners. We need a way to configure the context and allow it to be introspected prior to start so this deprecatesInitializableBeanContext
and replaces it withConfigurableBeanContext
andConfigurableApplicationContext
interfaces.These feature a
configure()
method that loads the bean definitions and state needed to start the context but doesn't actually start it.The PR also adds logic to assert the context is running when resolving beans which was missing before and could lead to odd behaviour.