1 /* 2 * Copyright 2002-2006 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springframework.beans.factory; 18 19 /** 20 * Sub-interface implemented by bean factories that can be part 21 * of a hierarchy. 22 * 23 * <p>The corresponding <code>setParentBeanFactory</code> method for bean 24 * factories that allow setting the parent in a configurable 25 * fashion can be found in the ConfigurableBeanFactory interface. 26 * 27 * @author Rod Johnson 28 * @author Juergen Hoeller 29 * @since 07.07.2003 30 * @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setParentBeanFactory 31 */ 32 public interface HierarchicalBeanFactory extends BeanFactory { 33 34 /** 35 * Return the parent bean factory, or <code>null</code> if there is none. 36 */ 37 BeanFactory getParentBeanFactory(); 38 39 /** 40 * Return whether the local bean factory contains a bean of the given name, 41 * ignoring beans defined in ancestor contexts. 42 * <p>This is an alternative to <code>containsBean</code>, ignoring a bean 43 * of the given name from an ancestor bean factory. 44 * @param name the name of the bean to query 45 * @return whether a bean with the given name is defined in the local factory 46 * @see org.springframework.beans.factory.BeanFactory#containsBean 47 */ 48 boolean containsLocalBean(String name); 49 50 } 51