spring-framework / org.springframework.beans.factory / SmartFactoryBean / isEagerInit

isEagerInit

open fun isEagerInit(): Boolean

Does this FactoryBean expect eager initialization, that is, eagerly initialize itself as well as expect eager initialization of its singleton object (if any)?

A standard FactoryBean is not expected to initialize eagerly: Its #getObject() will only be called for actual access, even in case of a singleton object. Returning true from this method suggests that #getObject() should be called eagerly, also applying post-processors eagerly. This may make sense in case of a singleton object, in particular if post-processors expect to be applied on startup.

The default implementation returns false.

Return
whether eager initialization applies

See Also
org.springframework.beans.factory.config.ConfigurableListableBeanFactory#preInstantiateSingletons()