Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2002-2008 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.config;
 
Configuration interface to be implemented by most listable bean factories. In addition to ConfigurableBeanFactory, it provides facilities to analyze and modify bean definitions, and to pre-instantiate singletons.

This subinterface of org.springframework.beans.factory.BeanFactory is not meant to be used in normal application code: Stick to org.springframework.beans.factory.BeanFactory or org.springframework.beans.factory.ListableBeanFactory for typical use cases. This interface is just meant to allow for framework-internal plug'n'play even when needing access to bean factory configuration methods.

Author(s):
Juergen Hoeller
Since:
03.11.2003
See also:
org.springframework.context.support.AbstractApplicationContext#getBeanFactory()
 
Ignore the given dependency type for autowiring: for example, String. Default is none.

Parameters:
type the dependency type to ignore
 
 	void ignoreDependencyType(Class type);

Ignore the given dependency interface for autowiring.

This will typically be used by application contexts to register dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.

By default, only the BeanFactoryAware interface is ignored. For further types to ignore, invoke this method for each type.

Parameters:
ifc the dependency interface to ignore
See also:
org.springframework.beans.factory.BeanFactoryAware
org.springframework.context.ApplicationContextAware
 
Register a special dependency type with corresponding autowired value.

This is intended for factory/context references that are supposed to be autowirable but are not defined as beans in the factory: e.g. a dependency of type ApplicationContext resolved to the ApplicationContext instance that the bean is living in.

Note: There are no such default types registered in a plain BeanFactory, not even for the BeanFactory interface itself.

Parameters:
dependencyType the dependency type to register. This will typically be a base interface such as BeanFactory, with extensions of it resolved as well if declared as an autowiring dependency (e.g. ListableBeanFactory), as long as the given value actually implements the extended interface.
autowiredValue the corresponding autowired value. This may also be an implementation of the org.springframework.beans.factory.ObjectFactory interface, which allows for lazy resolution of the actual target value.
 
 	void registerResolvableDependency(Class dependencyTypeObject autowiredValue);

Determine whether the specified bean qualifies as an autowire candidate, to be injected into other beans which declare a dependency of matching type.

This method checks ancestor factories as well.

Parameters:
beanName the name of the bean to check
descriptor the descriptor of the dependency to resolve
Returns:
whether the bean should be considered as autowire candidate
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException if there is no bean with the given name
 
 	boolean isAutowireCandidate(String beanNameDependencyDescriptor descriptor)
Return the registered BeanDefinition for the specified bean, allowing access to its property values and constructor argument value (which can be modified during bean factory post-processing).

A returned BeanDefinition object should not be a copy but the original definition object as registered in the factory. This means that it should be castable to a more specific implementation type, if necessary.

NOTE: This method does not consider ancestor factories. It is only meant for accessing local bean definitions of this factory.

Parameters:
beanName the name of the bean
Returns:
the registered BeanDefinition
Throws:
org.springframework.beans.factory.NoSuchBeanDefinitionException if there is no bean with the given name defined in this factory
Freeze all bean definitions, signalling that the registered bean definitions will not be modified or post-processed any further.

This allows the factory to aggressively cache bean definition metadata.

Return whether this factory's bean definitions are frozen, i.e. are not supposed to be modified or post-processed any further.

Returns:
true if the factory's configuration is considered frozen
Ensure that all non-lazy-init singletons are instantiated, also considering FactoryBeans. Typically invoked at the end of factory setup, if desired.

Throws:
org.springframework.beans.BeansException if one of the singleton beans could not be created. Note: This may have left the factory with some beans already initialized! Call ConfigurableBeanFactory.destroySingletons() for full cleanup in this case.
See also:
ConfigurableBeanFactory.destroySingletons()
New to GrepCode? Check out our FAQ X