Top Description Methods
org.springframework.beans.factory

public Interface BeanFactoryAware

extends Aware
Known Direct Implementers
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor, org.springframework.beans.factory.config.AbstractFactoryBean, org.springframework.beans.factory.config.MethodInvokingBean, org.springframework.beans.factory.config.PlaceholderConfigurerSupport, org.springframework.beans.factory.config.PropertyPathFactoryBean, org.springframework.beans.factory.config.ServiceLocatorFactoryBean, org.springframework.beans.factory.support.GenericTypeAwareAutowireCandidateResolver, org.springframework.beans.factory.wiring.BeanConfigurerSupport
Imports
org.springframework.beans.BeansException

Interface to be implemented by beans that wish to be aware of their owning BeanFactory.

For example, beans can look up collaborating beans via the factory (Dependency Lookup). Note that most beans will choose to receive references to collaborating beans via corresponding bean properties or constructor arguments (Dependency Injection).

For a list of all bean lifecycle methods, see the BeanFactory javadocs.

Authors
Rod Johnson, Chris Beams
Since
11.03.2003
See Also
BeanNameAware, BeanClassLoaderAware, InitializingBean, org.springframework.context.ApplicationContextAware

Method Summary

Modifier and TypeMethod and Description
public void
setBeanFactory(BeanFactory
owning BeanFactory (never null). The bean can immediately call methods on the factory.
beanFactory
)

Callback that supplies the owning factory to a bean instance.

Method Detail

setBeanFactoryback to summary
public void setBeanFactory(BeanFactory beanFactory) throws BeansException

Callback that supplies the owning factory to a bean instance.

Invoked after the population of normal bean properties but before an initialization callback such as InitializingBean#afterPropertiesSet() or a custom init-method.

Parameters
beanFactory:BeanFactory

owning BeanFactory (never null). The bean can immediately call methods on the factory.

Exceptions
BeansException:
in case of initialization errors
See Also
BeanInitializationException