public class

BeanConfigurerSupport

extends Object
implements BeanFactoryAware DisposableBean InitializingBean
java.lang.Object
   ↳ org.springframework.beans.factory.wiring.BeanConfigurerSupport

Class Overview

Convenient base class for configurers that can perform Dependency Injection on objects (however they may be created). Typically subclassed by AspectJ aspects.

Subclasses may also need a custom metadata resolution strategy, in the BeanWiringInfoResolver interface. The default implementation looks for a bean with the same name as the fully-qualified class name. (This is the default name of the bean in a Spring XML file if the 'id' attribute is not used.)

Summary

Fields
protected final Log logger Logger available to subclasses
Public Constructors
BeanConfigurerSupport()
Public Methods
void afterPropertiesSet()
Check that a BeanFactory has been set.
void configureBean(Object beanInstance)
Configure the bean instance.
void destroy()
Release references to the BeanFactory and BeanWiringInfoResolver when the container is destroyed.
void setBeanFactory(BeanFactory beanFactory)
Set the BeanFactory in which this aspect must configure beans.
void setBeanWiringInfoResolver(BeanWiringInfoResolver beanWiringInfoResolver)
Set the BeanWiringInfoResolver to use.
Protected Methods
BeanWiringInfoResolver createDefaultBeanWiringInfoResolver()
Create the default BeanWiringInfoResolver to be used if none was specified explicitly.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.BeanFactoryAware
From interface org.springframework.beans.factory.DisposableBean
From interface org.springframework.beans.factory.InitializingBean

Fields

protected final Log logger

Also: SpringBeans

Logger available to subclasses

Public Constructors

public BeanConfigurerSupport ()

Also: SpringBeans

Public Methods

public void afterPropertiesSet ()

Also: SpringBeans

Check that a BeanFactory has been set.

public void configureBean (Object beanInstance)

Also: SpringBeans

Configure the bean instance.

Subclasses can override this to provide custom configuration logic. Typically called by an aspect, for all bean instances matched by a pointcut.

Parameters
beanInstance the bean instance to configure (must not be null)

public void destroy ()

Also: SpringBeans

Release references to the BeanFactory and BeanWiringInfoResolver when the container is destroyed.

public void setBeanFactory (BeanFactory beanFactory)

Also: SpringBeans

Set the BeanFactory in which this aspect must configure beans.

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

public void setBeanWiringInfoResolver (BeanWiringInfoResolver beanWiringInfoResolver)

Also: SpringBeans

Set the BeanWiringInfoResolver to use.

The default behavior is to look for a bean with the same name as the class. As an alternative, consider using annotation-driven bean wiring.

Protected Methods

protected BeanWiringInfoResolver createDefaultBeanWiringInfoResolver ()

Also: SpringBeans

Create the default BeanWiringInfoResolver to be used if none was specified explicitly.

The default implementation builds a ClassNameBeanWiringInfoResolver.

Returns
  • the default BeanWiringInfoResolver (never null)