Java Doc for AutowireCapableBeanFactory.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » factory » config » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.beans.factory.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.beans.factory.config.AutowireCapableBeanFactory

All known Subclasses:   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory,
AutowireCapableBeanFactory
public interface AutowireCapableBeanFactory extends BeanFactory(Code)
Extension of the org.springframework.beans.factory.BeanFactory interface to be implemented by bean factories that are capable of autowiring, provided that they want to expose this functionality for existing bean instances.

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.
author:
   Juergen Hoeller
since:
   04.12.2003
See Also:   org.springframework.beans.factory.BeanFactoryAware
See Also:   org.springframework.beans.factory.config.ConfigurableListableBeanFactory
See Also:   org.springframework.context.ApplicationContext.getAutowireCapableBeanFactory



Field Summary
 intAUTOWIRE_AUTODETECT
     Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.
 intAUTOWIRE_BY_NAME
     Constant that indicates autowiring bean properties by name.
 intAUTOWIRE_BY_TYPE
     Constant that indicates autowiring bean properties by type.
 intAUTOWIRE_CONSTRUCTOR
     Constant that indicates autowiring a constructor.
 intAUTOWIRE_NO
     Constant that indicates no autowiring at all (other than callbacks such as BeanFactoryAware).


Method Summary
 ObjectapplyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
     Apply BeanPostProcessor BeanPostProcessors to the given existing bean instance, invoking their postProcessAfterInitialization methods.
 ObjectapplyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
     Apply BeanPostProcessor BeanPostProcessors to the given existing bean instance, invoking their postProcessBeforeInitialization methods.
 voidapplyBeanPropertyValues(Object existingBean, String beanName)
     Apply the property values of the bean definition with the given name to the given bean instance.
 Objectautowire(Class beanClass, int autowireMode, boolean dependencyCheck)
     Instantiate a new bean instance of the given class with the specified autowire strategy.
 voidautowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
     Autowire the bean properties of the given bean instance by name or type.
 ObjectconfigureBean(Object existingBean, String beanName)
     Configure the given bean instance: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors.
 ObjectcreateBean(Class beanClass, int autowireMode, boolean dependencyCheck)
     Fully create a new bean instance of the given class with the specified autowire strategy.
 ObjectinitializeBean(Object existingBean, String beanName)
     Initialize the given bean instance, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors.

Note that no bean definition of the given name has to exist in the bean factory.


Field Detail
AUTOWIRE_AUTODETECT
int AUTOWIRE_AUTODETECT(Code)
Constant that indicates determining an appropriate autowire strategy through introspection of the bean class.
See Also:   AutowireCapableBeanFactory.createBean
See Also:   AutowireCapableBeanFactory.autowire



AUTOWIRE_BY_NAME
int AUTOWIRE_BY_NAME(Code)
Constant that indicates autowiring bean properties by name.
See Also:   AutowireCapableBeanFactory.createBean
See Also:   AutowireCapableBeanFactory.autowire
See Also:   AutowireCapableBeanFactory.autowireBeanProperties



AUTOWIRE_BY_TYPE
int AUTOWIRE_BY_TYPE(Code)
Constant that indicates autowiring bean properties by type.
See Also:   AutowireCapableBeanFactory.createBean
See Also:   AutowireCapableBeanFactory.autowire
See Also:   AutowireCapableBeanFactory.autowireBeanProperties



AUTOWIRE_CONSTRUCTOR
int AUTOWIRE_CONSTRUCTOR(Code)
Constant that indicates autowiring a constructor.
See Also:   AutowireCapableBeanFactory.createBean
See Also:   AutowireCapableBeanFactory.autowire



AUTOWIRE_NO
int AUTOWIRE_NO(Code)
Constant that indicates no autowiring at all (other than callbacks such as BeanFactoryAware).
See Also:   AutowireCapableBeanFactory.createBean
See Also:   AutowireCapableBeanFactory.autowire
See Also:   AutowireCapableBeanFactory.autowireBeanProperties





Method Detail
applyBeanPostProcessorsAfterInitialization
Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeansException(Code)
Apply BeanPostProcessor 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
Parameters:
  beanName - the name of the bean the bean instance to use, either the original or a wrapped one
throws:
  BeansException - if any post-processing failed
See Also:   BeanPostProcessor.postProcessAfterInitialization



applyBeanPostProcessorsBeforeInitialization
Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) throws BeansException(Code)
Apply BeanPostProcessor 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
Parameters:
  beanName - the name of the bean the bean instance to use, either the original or a wrapped one
throws:
  BeansException - if any post-processing failed
See Also:   BeanPostProcessor.postProcessBeforeInitialization



applyBeanPropertyValues
void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException(Code)
Apply the property values of the bean definition with the given name to the given bean instance. The bean definition can either define a fully self-contained bean, reusing its property values, or just property values meant to be used for existing bean instances.

Note: This method does not autowire bean properties; it just applies explicitly defined property values. Use the AutowireCapableBeanFactory.autowireBeanProperties method to autowire an existing bean instance.
Parameters:
  existingBean - the existing bean instance
Parameters:
  beanName - the name of the bean definition in the bean factory(a bean definition of that name has to be available)
throws:
  org.springframework.beans.factory.NoSuchBeanDefinitionException - if there is no bean with the given name
throws:
  BeansException - if applying the property values failed
See Also:   AutowireCapableBeanFactory.autowireBeanProperties




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

Does not apply any BeanPostProcessor BeanPostProcessors or perform any further initialization of the bean. This interface offers distinct, fine-grained operations for those purposes, for example AutowireCapableBeanFactory.initializeBean .
Parameters:
  beanClass - the class of the bean to instantiate
Parameters:
  autowireMode - by name or type, using the constants in this interface
Parameters:
  dependencyCheck - whether to perform a dependency check for objectreferences in the bean instance (not applicable to autowiring a constructor,thus ignored there) the new bean instance
throws:
  BeansException - if instantiation or wiring failed
See Also:   AutowireCapableBeanFactory.AUTOWIRE_NO
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_NAME
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE
See Also:   AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR
See Also:   AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT
See Also:   AutowireCapableBeanFactory.initializeBean
See Also:   AutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization
See Also:   AutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization




autowireBeanProperties
void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck) throws BeansException(Code)
Autowire the bean properties of the given bean instance by name or type.
Parameters:
  existingBean - the existing bean instance
Parameters:
  autowireMode - by name or type, using the constants in this interface
Parameters:
  dependencyCheck - whether to perform a dependency check for objectreferences in the bean instance
throws:
  BeansException - if wiring failed
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_NAME
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE



configureBean
Object configureBean(Object existingBean, String beanName) throws BeansException(Code)
Configure the given bean instance: autowiring bean properties, applying bean property values, applying factory callbacks such as setBeanName and setBeanFactory, and also applying all bean post processors.

This is effectively a superset of what initializeBean provides, fully applying the configuration specified by the corresponding bean definition.
Parameters:
  existingBean - the existing bean instance
Parameters:
  beanName - the name of the bean, to be passed to it if necessary(a bean definition of that name has to be available) the bean instance to use, either the original or a wrapped one
throws:
  org.springframework.beans.factory.NoSuchBeanDefinitionException - if there is no bean with the given name
throws:
  BeansException - if the initialization failed
See Also:   AutowireCapableBeanFactory.initializeBean




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

Performs full initialization of the bean, including all applicable BeanPostProcessor BeanPostProcessors .
Parameters:
  beanClass - the class of the bean to create
Parameters:
  autowireMode - by name or type, using the constants in this interface
Parameters:
  dependencyCheck - whether to perform a dependency check for objects(not applicable to autowiring a constructor, thus ignored there) the new bean instance
throws:
  BeansException - if instantiation or wiring failed
See Also:   AutowireCapableBeanFactory.AUTOWIRE_NO
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_NAME
See Also:   AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE
See Also:   AutowireCapableBeanFactory.AUTOWIRE_CONSTRUCTOR
See Also:   AutowireCapableBeanFactory.AUTOWIRE_AUTODETECT




initializeBean
Object initializeBean(Object existingBean, String beanName) throws BeansException(Code)
Initialize the given bean instance, applying factory callbacks such as setBeanName and setBeanFactory, also applying all bean post processors.

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.
Parameters:
  existingBean - the existing bean instance
Parameters:
  beanName - the name of the bean, to be passed to it if necessary(only passed to BeanPostProcessor BeanPostProcessors) the bean instance to use, either the original or a wrapped one
throws:
  BeansException - if the initialization failed




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.