You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
Our instance supplier is taking care of creating the instance and applying autowiring. However, a traditional bean creation lifecycle is as follows, as far as I understood it:
Instance creation
Bean post-processing before initialization, typically invoking the Aware interface, see ApplicationContextAwareProcessor
PropertyValues injection
Bean post-processing after initialization, typically injecting @Autowired-annotated members
Right now, the order is more like 1, 4, 2, 3.
Invoking the aware interface is benign and doesn't involve reflection so we could keep it as is. Adding one post-processor per bean to apply autowiring sounds a bit invasive.
A chat with @jhoeller helped me fix the ordering. It's rather 1, 4, 2, 3. Because PropertyValues come last and are handled outside of the instance supplier, we may got a chance to get away with the current arrangement.
This commit moves handling of ImportAware in a bean post processor to
match the ordering of the regular runtime. As a result, bean instance
descriptor does not have to know about instance callbacks.
Closesgh-1014
This commit moves handling of ImportAware in a bean post processor to
match the ordering of the regular runtime. As a result, bean instance
descriptor does not have to know about instance callbacks.
Closesgh-1014
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Our instance supplier is taking care of creating the instance and applying autowiring. However, a traditional bean creation lifecycle is as follows, as far as I understood it:
Aware
interface, seeApplicationContextAwareProcessor
PropertyValues
injection@Autowired
-annotated membersRight now, the order is more like 1, 4, 2, 3.
Invoking the aware interface is benign and doesn't involve reflection so we could keep it as is. Adding one post-processor per bean to apply autowiring sounds a bit invasive.
WDYT @jhoeller
The text was updated successfully, but these errors were encountered: