org.springframework.beans.factory
Interface BeanFactoryAware

All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractAutoProxyCreator, AbstractBeanFactoryBasedTargetSource, AbstractBeanFactoryBasedTargetSourceCreator, AbstractPoolingTargetSource, AbstractPoolingTargetSourceCreator, AbstractPrototypeBasedTargetSource, AttributesPoolingTargetSourceCreator, AttributesPrototypeTargetSourceCreator, AttributesThreadLocalTargetSourceCreator, BeanNameAutoProxyCreator, BeanReferenceFactoryBean, CommonsPoolTargetSource, DefaultAdvisorAutoProxyCreator, HibernateAccessor, HibernateAccessor, HibernateInterceptor, HibernateInterceptor, HibernateTemplate, HibernateTemplate, HibernateTransactionManager, HibernateTransactionManager, LazyInitTargetSource, LazyInitTargetSourceCreator, LocalOjbConfigurer, MBeanExporter, ObjectFactoryCreatingFactoryBean, OpenSessionInViewInterceptor, OpenSessionInViewInterceptor, PreferencesPlaceholderConfigurer, PropertyPathFactoryBean, PropertyPlaceholderConfigurer, PrototypeTargetSource, ProxyFactoryBean, QuickTargetSourceCreator, ServiceLocatorFactoryBean, ServletContextPropertyPlaceholderConfigurer, ThreadLocalTargetSource, TransactionProxyFactoryBean

public interface BeanFactoryAware

Interface to be implemented by beans that wish to be aware of their owning BeanFactory. Beans can e.g. look up collaborating beans via the factory.

Note that most beans will choose to receive references to collaborating beans via respective bean properties.

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

Since:
11.03.2003
Author:
Rod Johnson
See Also:
BeanNameAware, InitializingBean, BeanFactory, ApplicationContextAware

Method Summary
 void setBeanFactory(BeanFactory beanFactory)
          Callback that supplies the owning factory to a bean instance.
 

Method Detail

setBeanFactory

void setBeanFactory(BeanFactory beanFactory)
                    throws BeansException
Callback that supplies the owning factory to a bean instance.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method.

Parameters:
beanFactory - owning BeanFactory (may not be null). The bean can immediately call methods on the factory.
Throws:
BeansException - in case of initialization errors
See Also:
BeanInitializationException


Copyright (c) 2002-2005 The Spring Framework Project.