Interface BeanFactoryAware

All Superinterfaces:
Aware
All Known Implementing Classes:
AbstractAdvisorAutoProxyCreator, AbstractApplicationEventMulticaster, AbstractAutoProxyCreator, AbstractBeanFactoryAwareAdvisingPostProcessor, AbstractBeanFactoryBasedTargetSource, AbstractBeanFactoryBasedTargetSourceCreator, AbstractBeanFactoryPointcutAdvisor, AbstractEntityManagerFactoryBean, AbstractFactoryBean, AbstractPoolingTargetSource, AbstractPrototypeBasedTargetSource, AbstractServiceLoaderBasedFactoryBean, AnnotatedEndpointConnectionManager, AnnotationAsyncExecutionInterceptor, AnnotationAwareAspectJAutoProxyCreator, AnnotationJmxAttributeSource, AnnotationMBeanExporter, AspectJAwareAdvisorAutoProxyCreator, AspectJExpressionPointcut, AspectJExpressionPointcutAdvisor, AsyncAnnotationAdvisor, AsyncAnnotationBeanPostProcessor, AsyncExecutionAspectSupport, AsyncExecutionInterceptor, AutowiredAnnotationBeanPostProcessor, BeanConfigurerSupport, BeanCreatingHandlerProvider, BeanFactoryCacheOperationSourceAdvisor, BeanFactoryConnectionFactoryLookup, BeanFactoryDataSourceLookup, BeanFactoryDestinationResolver, BeanFactoryJCacheOperationSourceAdvisor, BeanFactoryMessageChannelDestinationResolver, BeanFactoryTransactionAttributeSourceAdvisor, BeanNameAutoProxyCreator, CacheAspectSupport, CacheInterceptor, CacheProxyFactoryBean, CommonAnnotationBeanPostProcessor, CommonsPool2TargetSource, ContextAnnotationAutowireCandidateResolver, DefaultAdvisorAutoProxyCreator, DefaultBeanFactoryPointcutAdvisor, DefaultJCacheOperationSource, DefaultLifecycleProcessor, DefaultMessageHandlerMethodFactory, EndpointConnectionManager, EntityManagerFactoryAccessor, GenericMessagingTemplate, GenericTypeAwareAutowireCandidateResolver, GroovyScriptFactory, HibernateTransactionManager, InfrastructureAdvisorAutoProxyCreator, JmsListenerAnnotationBeanPostProcessor, JmsListenerEndpointRegistrar, JndiObjectFactoryBean, JpaTransactionManager, LazyInitTargetSource, LazyInitTargetSourceCreator, ListFactoryBean, LoadTimeWeaverAwareProcessor, LocalContainerEntityManagerFactoryBean, LocalEntityManagerFactoryBean, LocalSessionFactoryBean, MapFactoryBean, MBeanExportConfiguration, MBeanExporter, MethodInvokingBean, MethodInvokingFactoryBean, MethodInvokingJobDetailFactoryBean, MethodJmsListenerEndpoint, MethodLocatingFactoryBean, MethodValidationPostProcessor, ObjectFactoryCreatingFactoryBean, OpenEntityManagerInViewInterceptor, PerConnectionWebSocketHandler, PersistenceAnnotationBeanPostProcessor, PersistenceExceptionTranslationInterceptor, PersistenceExceptionTranslationPostProcessor, PlaceholderConfigurerSupport, PreferencesPlaceholderConfigurer, PropertyPathFactoryBean, PropertyPlaceholderConfigurer, PropertySourcesPlaceholderConfigurer, PrototypeTargetSource, ProviderCreatingFactoryBean, ProxyFactoryBean, QualifierAnnotationAutowireCandidateResolver, QuickTargetSourceCreator, RequestMappingHandlerAdapter, ScheduledAnnotationBeanPostProcessor, SchedulerAccessorBean, ScopedProxyFactoryBean, ScriptFactoryPostProcessor, ServerEndpointRegistration, ServiceFactoryBean, ServiceListFactoryBean, ServiceLoaderFactoryBean, ServiceLocatorFactoryBean, SetFactoryBean, SharedEntityManagerBean, SimpleApplicationEventMulticaster, SimpleBeanFactoryAwareAspectInstanceFactory, SimpleBeanTargetSource, SortedResourcesFactoryBean, TaskSchedulerRouter, ThreadLocalTargetSource, TransactionAspectSupport, TransactionInterceptor, TransactionProxyFactoryBean, WebAsyncTask

public interface BeanFactoryAware extends Aware
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.

Since:
11.03.2003
Author:
Rod Johnson, Chris Beams
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Callback that supplies the owning factory to a bean instance.
  • Method Details

    • setBeanFactory

      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 - owning BeanFactory (never null). The bean can immediately call methods on the factory.
      Throws:
      BeansException - in case of initialization errors
      See Also: