日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

HierarchicalBeanFactory接口

發(fā)布時間:2023/12/10 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HierarchicalBeanFactory接口 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.


HierarchicalBeanFactory 提供父容器的訪問功能.至于父容器的設(shè)置,需要找ConfigurableBeanFactory的setParentBeanFactory(接口把設(shè)置跟獲取給拆開了!).
HierarchicalBeanFactory源碼具體:

1、第一個方法返回本Bean工廠的父工廠。這個方法實現(xiàn)了工廠的分層。

2、第二個方法判斷本地工廠是否包含這個Bean(忽略其他所有父工廠)。這也是分層思想的體現(xiàn)。

總結(jié):這個工廠接口非常簡單,實現(xiàn)了Bean工廠的分層。這個工廠接口也是繼承自BeanFacotory,也是一個二級接口,相對于父接口,它只擴展了一個重要的功能——工廠分層。

/*** Sub-interface implemented by bean factories that can be part* of a hierarchy.** <p>The corresponding {@code setParentBeanFactory} method for bean* factories that allow setting the parent in a configurable* fashion can be found in the ConfigurableBeanFactory interface.** @author Rod Johnson* @author Juergen Hoeller* @since 07.07.2003* @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setParentBeanFactory*/ public interface HierarchicalBeanFactory extends BeanFactory {/*** Return the parent bean factory, or {@code null} if there is none.*/// // 返回本Bean工廠的父工廠BeanFactory getParentBeanFactory();/*** Return whether the local bean factory contains a bean of the given name,* ignoring beans defined in ancestor contexts.* <p>This is an alternative to {@code containsBean}, ignoring a bean* of the given name from an ancestor bean factory.* @param name the name of the bean to query* @return whether a bean with the given name is defined in the local factory* @see BeanFactory#containsBean*/// 本地工廠(容器)是否包含這個Beanboolean containsLocalBean(String name);}

總結(jié)

以上是生活随笔為你收集整理的HierarchicalBeanFactory接口的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。