springboot初始化过程,spring初始化卡住
org.spring framework.beans.factory包下的接口是初始化bean的唯一方法。
//*
* invokedbyabeanfactoryafterithassetallbeanpropertiessupplied
* andsatisfiedbeanfactoryawareandapplicationcontextaware。
* pthismethodallowsthebeaninstancetoperforminitializationonly
* possiblewhenallbeanpropertieshavebeensetandtothrowan
*扩展intheeventofmisconfiguration。
* @ throwsexceptionintheeventofmisconfiguration (such
* asfailuretosetanessentialproperty (初始化文件)。
*/
void afterPropertiesSet () throws Exception;
在所有属性初始化后调用此方法。
但是,它会在init之前调用。
但是,如果主要是延迟加载,则立即执行。
可以对类进行评论。
importorg.spring帧work.context.annotation.lazy;
@lazy(false )
这将在初始化spring容器时调用afterPropertiesSet。
只需要实现InitializingBean接口。
代码在这里初始化的话,半天也找不到。
转载于:https://www.cn blogs.com/Java-boy/archive/2012/12/21/2827729.html