HierarchicalBeanFactory   字面意思是分层工厂,

那么这个工厂是怎么分层的呢?

package org.springframework.beans.factory;


 //分层工厂
public interface HierarchicalBeanFactory extends BeanFactory {


     //返回工厂的父工厂
    BeanFactory getParentBeanFactory();

     //这个工厂中是否包含这个Bean
    boolean containsLocalBean(String name);

}

方法1.中直接返回了父工厂。

方法2,中判断了本地的工厂中是否包含了这个Bean,

这个接口中得方法很少,

它只扩展了一个重要的功能——工厂分层

 

 

相关文章:

  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-03-06
  • 2022-02-12
  • 2022-03-01
  • 2022-12-23
  • 2021-12-24
猜你喜欢
  • 2021-11-08
  • 2021-09-28
  • 2022-01-27
  • 2021-08-17
  • 2021-04-17
  • 2022-12-23
  • 2021-11-05
相关资源
相似解决方案