首页天道酬勤springboot初始化过程,spring初始化卡住

springboot初始化过程,spring初始化卡住

admin 05-04 20:22 91次浏览

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

Docker发布镜像到DockerHub元素值在通过react-transition-group转换之前发生变化和变化
java @component,paginationinterceptor afterpropertiesset,spring事务注解原理
相关内容