org.springframework.beans.factory.config
Interface AutowireCapableBeanFactory

All Superinterfaces:
BeanFactory
All Known Subinterfaces:
ConfigurableListableBeanFactory
All Known Implementing Classes:
AbstractAutowireCapableBeanFactory, DefaultListableBeanFactory

public interface AutowireCapableBeanFactory
extends BeanFactory

Extension of the BeanFactory interface to be implemented by bean factories that are capable of autowiring and expose this functionality for existing bean instances.

Since:
04.12.2003
Version:
$Id: AutowireCapableBeanFactory.java,v 1.4 2004/03/18 02:46:07 trisberg Exp $
Author:
Juergen Hoeller

Field Summary
static int AUTOWIRE_AUTODETECT
          Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.
static int AUTOWIRE_BY_NAME
          Constant that indicates autowiring by name.
static int AUTOWIRE_BY_TYPE
          Constant that indicates autowiring by type.
static int AUTOWIRE_CONSTRUCTOR
          Constant that indicates autowiring a constructor.
 
Method Summary
 java.lang.Object applyBeanPostProcessorsAfterInitialization(java.lang.Object existingBean, java.lang.String name)
          Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods.
 java.lang.Object applyBeanPostProcessorsBeforeInitialization(java.lang.Object existingBean, java.lang.String name)
          Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods.
 java.lang.Object autowire(java.lang.Class beanClass, int autowireMode, boolean dependencyCheck)
          Create a new bean instance of the given class with the specified autowire strategy.
 void autowireBeanProperties(java.lang.Object existingBean, int autowireMode, boolean dependencyCheck)
          Autowire the bean properties of the given bean instance by name or type.
 
Methods inherited from interface org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, isSingleton
 

Field Detail

AUTOWIRE_BY_NAME

public static final int AUTOWIRE_BY_NAME
Constant that indicates autowiring by name.

See Also:
autowire(java.lang.Class, int, boolean), autowireBeanProperties(java.lang.Object, int, boolean), Constant Field Values

AUTOWIRE_BY_TYPE

public static final int AUTOWIRE_BY_TYPE
Constant that indicates autowiring by type.

See Also:
autowire(java.lang.Class, int, boolean), autowireBeanProperties(java.lang.Object, int, boolean), Constant Field Values

AUTOWIRE_CONSTRUCTOR

public static final int AUTOWIRE_CONSTRUCTOR
Constant that indicates autowiring a constructor.

See Also:
autowire(java.lang.Class, int, boolean), Constant Field Values

AUTOWIRE_AUTODETECT

public static final int AUTOWIRE_AUTODETECT
Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.

See Also:
autowire(java.lang.Class, int, boolean), Constant Field Values
Method Detail

autowire

public java.lang.Object autowire(java.lang.Class beanClass,
                                 int autowireMode,
                                 boolean dependencyCheck)
                          throws BeansException
Create a new bean instance of the given class with the specified autowire strategy. All constants defined in this interface are supported here.

Parameters:
beanClass - the class of the bean to instantiate
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for objects (not applicable to autowiring a constructor, thus ignored there)
Returns:
the new bean instance
Throws:
BeansException - if instantiation respectively wiring failed
See Also:
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_AUTODETECT

autowireBeanProperties

public void autowireBeanProperties(java.lang.Object existingBean,
                                   int autowireMode,
                                   boolean dependencyCheck)
                            throws BeansException
Autowire the bean properties of the given bean instance by name or type.

Parameters:
existingBean - the existing bean instance
autowireMode - by name or type, using the constants in this interface
dependencyCheck - whether to perform a dependency check for object
Throws:
BeansException - if wiring failed
See Also:
AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE

applyBeanPostProcessorsBeforeInitialization

public java.lang.Object applyBeanPostProcessorsBeforeInitialization(java.lang.Object existingBean,
                                                                    java.lang.String name)
                                                             throws BeansException
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods. The returned bean instance may be a wrapper around the original.

Parameters:
existingBean - the new bean instance
name - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessBeforeInitialization(java.lang.Object, java.lang.String)

applyBeanPostProcessorsAfterInitialization

public java.lang.Object applyBeanPostProcessorsAfterInitialization(java.lang.Object existingBean,
                                                                   java.lang.String name)
                                                            throws BeansException
Apply BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods. The returned bean instance may be a wrapper around the original.

Parameters:
existingBean - the new bean instance
name - the name of the bean
Returns:
the bean instance to use, either the original or a wrapped one
Throws:
BeansException - if any post-processing failed
See Also:
BeanPostProcessor.postProcessAfterInitialization(java.lang.Object, java.lang.String)


Copyright (C) 2003-2004 The Spring Framework Project.