zoukankan      html  css  js  c++  java
  • spring源码 HierarchicalBeanFactory接口

     HierarchicalBeanFactory 表示的是这些 Bean 是有继承关系的,也就是每个Bean 有可能有父 Bean。

       

    /*
     * Copyright 2002-2012 the original author or authors.
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *      http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    
    package org.springframework.beans.factory;
    
    /**
     * Sub-interface implemented by bean factories that can be part
     * of a hierarchy.
     * 可以被作为分层结构中的一个部分的bean工厂实现
     * <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.
     *那些允许以配置的方式设置其父工厂的bean工厂对应的方法setParentBeanFactory可以在接口setParent中找到
     * @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.
         返回BeanFactory,如果没有则返回Null
    */ BeanFactory getParentBeanFactory(); /** * Return whether the local bean factory contains a bean of the given name, * ignoring beans defined in ancestor contexts.
        返回当前bean工厂上下文是否存在给定bean名字的bean,忽略定义在其继承层次中的工厂上下文 * <p>This is an alternative to {
    @code containsBean}, ignoring a bean * of the given name from an ancestor bean factory.
        containsBean方法于此方法是二选一的,都忽略其继承层中的bean定义,只在当前层次中查找 *
    @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 */ boolean containsLocalBean(String name); }
  • 相关阅读:
    C#域名解析
    【转】正则基础之——贪婪与非贪婪模式
    【转】正则基础之——神奇的转义
    总结:实例化SqlParameter时,如果是字符型,一定要指定size属性,还有制定具体的类型
    从数据库里随机读取几条数据
    Html异步下载分析
    C#生成验证码程序
    【转】正则应用之——逆序环视探索
    如何用class在Dictionary里面作为Key使用
    【转】SqlDataReader 提前终止的性能问题
  • 原文地址:https://www.cnblogs.com/lkeji388/p/9336772.html
Copyright © 2011-2022 走看看