NOTE

Spring IoC Source: Instantiating Non-Lazy Singletons

How Spring resolves bean dependencies, creates singleton instances, applies lifecycle processors, and caches exposed objects.

JavaCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

Near the end of context refresh, Spring creates non-lazy singleton beans.

For each bean, the container resolves metadata/dependencies, instantiates the object, populates dependencies/properties, applies awareness/lifecycle callbacks and post-processors, and stores the exposed singleton (which may be a proxy).

Dependency graphs drive creation order. Early-reference mechanisms used for some circular dependencies are implementation details and should not replace good dependency design.

Loading helpful count