package org.springframework.beans.factory;
/**
* 如果一个类实现了该接口,则该类在属性全部初始化后,会立即调用afterPropertiesSet方法。使用场景:我们需要自定义某个类的初始化方法。
*
* Interface to be implemented by beans that need to react once all their properties have been set by a BeanFactory: for example, to perform custom
* for example, to perform custom initialization.
*/
public interface InitializingBean {
/**
* Invoked by a BeanFactory after it has set all bean properties supplied
*/
void afterPropertiesSet() throws Exception;
}
Spring中的InitializingBean
最新推荐文章于 2025-02-24 11:16:09 发布