All Implemented Interfaces:
BeanFactory
All Known Implementing Classes:
DefaultListableBeanFactory, AbstractAutowireCapableBeanFactory, XmlBeanFactory, ConfigurableListableBeanFactory
This subinterface of BeanFactory is not meant to be used in normal application code: stick to org.springframework.beans.factory.BeanFactory or org.springframework.beans.factory.ListableBeanFactory for typical use cases.
Integration code for other frameworks can leverage this interface to wire and populate existing bean instances that Spring does not control the lifecycle of. This is particularly useful for WebWork Actions and Tapestry Page objects, for example.
Note that this interface is not implemented by org.springframework.context.ApplicationContext facades, as it is hardly ever used by application code. That said, it is available from an application context too, accessible through ApplicationContext's org.springframework.context.ApplicationContext#getAutowireCapableBeanFactory() method.
You may also implement the org.springframework.beans.factory.BeanFactoryAware interface, which exposes the internal BeanFactory even when running in an ApplicationContext, to get access to an AutowireCapableBeanFactory: simply cast the passed-in BeanFactory to AutowireCapableBeanFactory.
Juergen - Hoeller04.12.2003 - | Field Summary | ||
|---|---|---|
| int | AUTOWIRE_NO | Constant that indicates no externally defined autowiring. Note that BeanFactoryAware etc and annotation-driven injection will still be applied. |
| int | AUTOWIRE_BY_NAME | Constant that indicates autowiring bean properties by name (applying to all bean property setters). |
| int | AUTOWIRE_BY_TYPE | Constant that indicates autowiring bean properties by type (applying to all bean property setters). |
| int | AUTOWIRE_CONSTRUCTOR | Constant that indicates autowiring the greediest constructor that
can be satisfied (involves resolving the appropriate constructor).
|
| int | AUTOWIRE_AUTODETECT | Constant that indicates determining an appropriate autowire strategy
through introspection of the bean class.
|
| Method from org.springframework.beans.factory.config.AutowireCapableBeanFactory Summary: |
|---|
| applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, initializeBean, resolveDependency, resolveDependency |
| Method from org.springframework.beans.factory.config.AutowireCapableBeanFactory Detail: |
|---|
postProcessAfterInitialization methods.
The returned bean instance may be a wrapper around the original. |
postProcessBeforeInitialization methods.
The returned bean instance may be a wrapper around the original. |
This method does not autowire bean properties; it just applies explicitly defined property values. Use the #autowireBeanProperties method to autowire an existing bean instance. Note: This method requires a bean definition for the given name! Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example #initializeBean . However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance. |
AUTOWIRE_NO in order to just apply
before-instantiation callbacks (e.g. for annotation-driven injection).
Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example #initializeBean . However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the construction of the instance. |
Note: This is essentially intended for (re-)populating annotated fields and methods, either for new instances or for deserialized instances. It does not imply traditional by-name or by-type autowiring of properties; use #autowireBeanProperties for that purposes. |
AUTOWIRE_NO in order to just apply
after-instantiation callbacks (e.g. for annotation-driven injection).
Does not apply standard BeanPostProcessors callbacks or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example #initializeBean . However, InstantiationAwareBeanPostProcessor callbacks are applied, if applicable to the configuration of the instance. |
setBeanName
and setBeanFactory, and also applying all bean post processors
(including ones which might wrap the given raw bean).
This is effectively a superset of what #initializeBean provides, fully applying the configuration specified by the corresponding bean definition. Note: This method requires a bean definition for the given name! |
Performs full initialization of the bean, including all applicable BeanPostProcessors . Note: This is intended for creating a fresh instance, populating annotated fields and methods as well as applying all standard bean initialiation callbacks. It does not> imply traditional by-name or by-type autowiring of properties; use #createBean(Class, int, boolean) for that purposes. |
Performs full initialization of the bean, including all applicable BeanPostProcessors . This is effectively a superset of what #autowire provides, adding #initializeBean behavior. |
setBeanName and setBeanFactory,
also applying all bean post processors (including ones which
might wrap the given raw bean).
Note that no bean definition of the given name has to exist in the bean factory. The passed-in bean name will simply be used for callbacks but not checked against the registered bean definitions. |
|
|