BeanFactory bootstrap. This interface can be implemented by
singleton beans in order to perform some initialization after the regular
singleton instantiation algorithm, avoiding side effects with accidental early
initialization (e.g. from ListableBeanFactory#getBeansOfType calls).
In that sense, it is an alternative to InitializingBean which gets
triggered right at the end of a bean's local construction phase.
This callback variant is somewhat similar to
org. but doesn't
require an implementation of org.,
with no need to filter context references across a context hierarchy etc.
It also implies a more minimal dependency on just the beans package
and is being honored by standalone ListableBeanFactory implementations,
not just in an org. environment.
Note
If you intend to start/manage asynchronous tasks, preferably
implement org. instead which offers
a richer model for runtime management and allows for phased startup/shutdown.
org.springframework.beans.factory.config.ConfigurableListableBeanFactory#preInstantiateSingletons()
| Modifier and Type | Method and Description |
|---|---|
| public void | afterSingletonsInstantiated()
Invoked right at the end of the singleton pre-instantiation phase, with a guarantee that all regular singleton beans have been created already. |
| afterSingletonsInstantiated | back to summary |
|---|---|
| public void afterSingletonsInstantiated() Invoked right at the end of the singleton pre-instantiation phase,
with a guarantee that all regular singleton beans have been created
already. Note This callback won't be triggered for singleton beans
lazily initialized on demand after | |