Java Doc for AbstractAutowireCapableBeanFactory.java in  » J2EE » spring-framework-2.0.6 » org » springframework » beans » factory » support » 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.support 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
      org.springframework.beans.factory.support.AbstractBeanFactory
         org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory

All known Subclasses:   org.springframework.beans.factory.support.DefaultListableBeanFactory,
AbstractAutowireCapableBeanFactory
abstract public class AbstractAutowireCapableBeanFactory extends AbstractBeanFactory implements AutowireCapableBeanFactory(Code)
Abstract bean factory superclass that implements default bean creation, with the full capabilities specified by the RootBeanDefinition class. Implements the org.springframework.beans.factory.config.AutowireCapableBeanFactory interface in addition to AbstractBeanFactory's AbstractAutowireCapableBeanFactory.createBean method.

Provides bean creation (with constructor resolution), property population, wiring (including autowiring), and initialization. Handles runtime bean references, resolves managed collections, calls initialization methods, etc. Supports autowiring constructors, properties by name, and properties by type.

The main template method to be implemented by subclasses is AbstractAutowireCapableBeanFactory.findAutowireCandidates , used for autowiring by type. In case of a factory which is capable of searching its bean definitions, matching beans will typically be implemented through such a search. For other factory styles, simplified matching algorithms can be implemented.

Note that this class does not assume or implement bean definition registry capabilities. See DefaultListableBeanFactory for an implementation of the org.springframework.beans.factory.ListableBeanFactory and BeanDefinitionRegistry interfaces, which represent the API and SPI view of such a factory, respectively.
author:
   Rod Johnson
author:
   Juergen Hoeller
author:
   Rob Harrop
since:
   13.02.2004
See Also:   RootBeanDefinition
See Also:   DefaultListableBeanFactory
See Also:   BeanDefinitionRegistry




Constructor Summary
public  AbstractAutowireCapableBeanFactory()
     Create a new AbstractAutowireCapableBeanFactory.
public  AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory)
     Create a new AbstractAutowireCapableBeanFactory with the given parent.

Method Summary
public  ObjectapplyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
    
public  ObjectapplyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
    
protected  ObjectapplyBeanPostProcessorsBeforeInstantiation(Class beanClass, String beanName)
     Apply InstantiationAwareBeanPostProcessors to the specified bean definition (by class and name), invoking their postProcessBeforeInstantiation methods.

Any returned object will be used as the bean instead of actually instantiating the target bean.

public  voidapplyBeanPropertyValues(Object existingBean, String beanName)
    
protected  voidapplyPropertyValues(String beanName, RootBeanDefinition mbd, BeanWrapper bw, PropertyValues pvs)
     Apply the given property values, resolving any runtime references to other beans in this bean factory.
public  Objectautowire(Class beanClass, int autowireMode, boolean dependencyCheck)
    
public  voidautowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
    
protected  voidautowireByName(String beanName, RootBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)
     Fill in any missing property values with references to other beans in this factory if autowire is set to "byName".
protected  voidautowireByType(String beanName, RootBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)
     Abstract method defining "autowire by type" (bean properties by type) behavior.

This is like PicoContainer default, in which there must be exactly one bean of the property type in the bean factory.

protected  BeanWrapperautowireConstructor(String beanName, RootBeanDefinition mbd, Constructor ctor)
     "autowire constructor" (with constructor arguments by type) behavior.
protected  voidcheckDependencies(String beanName, RootBeanDefinition mbd, PropertyDescriptor[] pds, PropertyValues pvs)
     Perform a dependency check that all properties exposed have been set, if desired.
public  ObjectconfigureBean(Object existingBean, String beanName)
    
public  voidcopyConfigurationFrom(ConfigurableBeanFactory otherFactory)
    
public  ObjectcreateBean(Class beanClass, int autowireMode, boolean dependencyCheck)
    
protected  ObjectcreateBean(String beanName, RootBeanDefinition mbd, Object[] args)
     Central method of this class: creates a bean instance, populates the bean instance, applies post-processors, etc.
protected  BeanWrappercreateBeanInstance(String beanName, RootBeanDefinition mbd, Object[] args)
     Create a new instance for the specified bean, using an appropriate instantiation strategy: factory method, constructor autowiring, or simple instantiation.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean
Parameters:
  args - arguments to use if creating a prototype using explicit arguments to astatic factory method.
protected  ConstructordetermineConstructorFromBeanPostProcessors(Class beanClass, String beanName)
     Determine the constructor to use for the given bean, checking all registered SmartInstantiationAwareBeanPostProcessor SmartInstantiationAwareBeanPostProcessors .
protected  PropertyDescriptor[]filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw)
     Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces.
protected  MapfindAutowireCandidates(String beanName, Class requiredType)
     Find bean instances that match the required type.
protected  MapfindMatchingBeans(Class requiredType)
     Find bean instances that match the required type.
protected  InstantiationStrategygetInstantiationStrategy()
     Return the instantiation strategy to use for creating bean instances.
protected  ClassgetTypeForFactoryBean(String beanName, RootBeanDefinition mbd)
     This implementation checks the FactoryBean's getObjectType method on a plain instance of the FactoryBean, without bean properties applied yet. If this doesn't return a type yet, a full creation of the FactoryBean is used as fallback (through delegation to the superclass's implementation).

The shortcut check for a FactoryBean is only applied in case of a singleton FactoryBean.

protected  ClassgetTypeForFactoryMethod(String beanName, RootBeanDefinition mbd)
     Determine the bean type for the given bean definition which is based on a factory method.
public  voidignoreDependencyInterface(Class ifc)
     Ignore the given dependency interface for autowiring.
public  voidignoreDependencyType(Class type)
     Ignore the given dependency type for autowiring: for example, String.
public  ObjectinitializeBean(Object existingBean, String beanName)
    
protected  ObjectinitializeBean(String beanName, Object bean, RootBeanDefinition mbd)
     Initialize the given bean instance, applying factory callbacks as well as init methods and bean post processors.
protected  BeanWrapperinstantiateBean(String beanName, RootBeanDefinition mbd)
     Instantiate the given bean using its default constructor.
protected  BeanWrapperinstantiateUsingFactoryMethod(String beanName, RootBeanDefinition mbd, Object[] explicitArgs)
     Instantiate the bean using a named factory method.
protected  voidinvokeCustomInitMethod(String beanName, Object bean, String initMethodName, boolean enforceInitMethod)
     Invoke the specified custom init method on the given bean.
protected  voidinvokeInitMethods(String beanName, Object bean, RootBeanDefinition mbd)
     Give a bean a chance to react now all its properties are set, and a chance to know about its owning bean factory (this object).
protected  booleanisExcludedFromDependencyCheck(PropertyDescriptor pd)
     Determine whether the given bean property is excluded from dependency checks.
protected  voidpopulateBean(String beanName, RootBeanDefinition mbd, BeanWrapper bw)
     Populate the bean instance in the given BeanWrapper with the property values from the bean definition.
protected  ObjectpostProcessObjectFromFactoryBean(Object object, String beanName)
     Applies the postProcessAfterInitialization callback of all registered BeanPostProcessors, giving them a chance to post-process the object obtained from FactoryBeans (for example, to auto-proxy them).
protected  ClasspredictBeanType(String beanName, RootBeanDefinition mbd)
     Predict the eventual bean type for the given bean.
protected  voidremoveSingleton(String beanName)
     Overridden to clear FactoryBean instance cache as well.
public  voidsetAllowCircularReferences(boolean allowCircularReferences)
     Set whether to allow circular references between beans - and automatically try to resolve them.

Note that circular reference resolution means that one of the involved beans will receive a reference to another bean that is not fully initialized yet. This can lead to subtle and not-so-subtle side effects on initialization; it does work fine for many scenarios, though.

Default is "true".

public  voidsetAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping)
     Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying).

This will only be used as a last resort in case of a circular reference that cannot be resolved otherwise: essentially, preferring a raw instance getting injected over a failure of the entire bean wiring process.

Default is "false", as of Spring 2.0.

public  voidsetInstantiationStrategy(InstantiationStrategy instantiationStrategy)
     Set the instantiation strategy to use for creating bean instances.
protected  String[]unsatisfiedNonSimpleProperties(RootBeanDefinition mbd, BeanWrapper bw)
     Return an array of non-simple bean properties that are unsatisfied. These are probably unsatisfied references to other beans in the factory.


Constructor Detail
AbstractAutowireCapableBeanFactory
public AbstractAutowireCapableBeanFactory()(Code)
Create a new AbstractAutowireCapableBeanFactory.



AbstractAutowireCapableBeanFactory
public AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory)(Code)
Create a new AbstractAutowireCapableBeanFactory with the given parent.
Parameters:
  parentBeanFactory - parent bean factory, or null if none




Method Detail
applyBeanPostProcessorsAfterInitialization
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) throws BeansException(Code)



applyBeanPostProcessorsBeforeInitialization
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) throws BeansException(Code)



applyBeanPostProcessorsBeforeInstantiation
protected Object applyBeanPostProcessorsBeforeInstantiation(Class beanClass, String beanName) throws BeansException(Code)
Apply InstantiationAwareBeanPostProcessors to the specified bean definition (by class and name), invoking their postProcessBeforeInstantiation methods.

Any returned object will be used as the bean instead of actually instantiating the target bean. A null return value from the post-processor will result in the target bean being instantiated.
Parameters:
  beanClass - the class of the bean to be instantiated
Parameters:
  beanName - the name of the bean the bean object to use instead of a default instance of the target bean, or null
throws:
  BeansException - if any post-processing failed
See Also:   InstantiationAwareBeanPostProcessor.postProcessBeforeInstantiation




applyBeanPropertyValues
public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException(Code)



applyPropertyValues
protected void applyPropertyValues(String beanName, RootBeanDefinition mbd, BeanWrapper bw, PropertyValues pvs)(Code)
Apply the given property values, resolving any runtime references to other beans in this bean factory. Must use deep copy, so we don't permanently modify this property.
Parameters:
  beanName - the bean name passed for better exception information
Parameters:
  mbd - the merged bean definition
Parameters:
  bw - the BeanWrapper wrapping the target object
Parameters:
  pvs - the new property values



autowire
public Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException(Code)



autowireBeanProperties
public void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck) throws BeansException(Code)



autowireByName
protected void autowireByName(String beanName, RootBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)(Code)
Fill in any missing property values with references to other beans in this factory if autowire is set to "byName".
Parameters:
  beanName - the name of the bean we're wiring up.Useful for debugging messages; not used functionally.
Parameters:
  mbd - bean definition to update through autowiring
Parameters:
  bw - BeanWrapper from which we can obtain information about the bean
Parameters:
  pvs - the PropertyValues to register wired objects with



autowireByType
protected void autowireByType(String beanName, RootBeanDefinition mbd, BeanWrapper bw, MutablePropertyValues pvs)(Code)
Abstract method defining "autowire by type" (bean properties by type) behavior.

This is like PicoContainer default, in which there must be exactly one bean of the property type in the bean factory. This makes bean factories simple to configure for small namespaces, but doesn't work as well as standard Spring behavior for bigger applications.
Parameters:
  beanName - the name of the bean to autowire by type
Parameters:
  mbd - the merged bean definition to update through autowiring
Parameters:
  bw - BeanWrapper from which we can obtain information about the bean
Parameters:
  pvs - the PropertyValues to register wired objects with




autowireConstructor
protected BeanWrapper autowireConstructor(String beanName, RootBeanDefinition mbd, Constructor ctor)(Code)
"autowire constructor" (with constructor arguments by type) behavior. Also applied if explicit constructor argument values are specified, matching all remaining arguments with beans from the bean factory.

This corresponds to constructor injection: In this mode, a Spring bean factory is able to host components that expect constructor-based dependency resolution.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean
Parameters:
  ctor - the chosen candidate constructor BeanWrapper for the new instance




checkDependencies
protected void checkDependencies(String beanName, RootBeanDefinition mbd, PropertyDescriptor[] pds, PropertyValues pvs) throws UnsatisfiedDependencyException(Code)
Perform a dependency check that all properties exposed have been set, if desired. Dependency checks can be objects (collaborating beans), simple (primitives and String), or all (both).
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the merged bean definition the bean was created with
Parameters:
  pds - the relevant property descriptors for the target bean
Parameters:
  pvs - the property values to be applied to the bean
See Also:   AbstractAutowireCapableBeanFactory.isExcludedFromDependencyCheck(java.beans.PropertyDescriptor)



configureBean
public Object configureBean(Object existingBean, String beanName) throws BeansException(Code)



copyConfigurationFrom
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)(Code)



createBean
public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException(Code)



createBean
protected Object createBean(String beanName, RootBeanDefinition mbd, Object[] args) throws BeanCreationException(Code)
Central method of this class: creates a bean instance, populates the bean instance, applies post-processors, etc.

Differentiates between default bean instantiation, use of a factory method, and autowiring a constructor.
See Also:   AbstractAutowireCapableBeanFactory.instantiateBean
See Also:   AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod
See Also:   AbstractAutowireCapableBeanFactory.autowireConstructor




createBeanInstance
protected BeanWrapper createBeanInstance(String beanName, RootBeanDefinition mbd, Object[] args)(Code)
Create a new instance for the specified bean, using an appropriate instantiation strategy: factory method, constructor autowiring, or simple instantiation.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean
Parameters:
  args - arguments to use if creating a prototype using explicit arguments to astatic factory method. It is invalid to use a non-null args value in any other case. BeanWrapper for the new instance
See Also:   AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod
See Also:   AbstractAutowireCapableBeanFactory.autowireConstructor
See Also:   AbstractAutowireCapableBeanFactory.instantiateBean



determineConstructorFromBeanPostProcessors
protected Constructor determineConstructorFromBeanPostProcessors(Class beanClass, String beanName) throws BeansException(Code)
Determine the constructor to use for the given bean, checking all registered SmartInstantiationAwareBeanPostProcessor SmartInstantiationAwareBeanPostProcessors .
Parameters:
  beanClass - the raw class of the bean
Parameters:
  beanName - the name of the bean the constructor to use, or null if none specified
throws:
  org.springframework.beans.BeansException - in case of errors
See Also:   org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor.determineConstructor



filterPropertyDescriptorsForDependencyCheck
protected PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw)(Code)
Extract a filtered set of PropertyDescriptors from the given BeanWrapper, excluding ignored dependency types or properties defined on ignored dependency interfaces.
Parameters:
  bw - the BeanWrapper the bean was created with the filtered PropertyDescriptors
See Also:   AbstractAutowireCapableBeanFactory.isExcludedFromDependencyCheck



findAutowireCandidates
protected Map findAutowireCandidates(String beanName, Class requiredType) throws BeansException(Code)
Find bean instances that match the required type. Called during autowiring for the specified bean.

If a subclass cannot obtain information about bean names by type, a corresponding exception should be thrown.
Parameters:
  beanName - the name of the bean that is about to be wired
Parameters:
  requiredType - the type of the autowired property or argument a Map of candidate names and candidate instances that matchthe required type (never null)
throws:
  BeansException - in case of errors
See Also:   AbstractAutowireCapableBeanFactory.autowireByType
See Also:   AbstractAutowireCapableBeanFactory.autowireConstructor




findMatchingBeans
protected Map findMatchingBeans(Class requiredType) throws BeansException(Code)
Find bean instances that match the required type. Called by autowiring.
Parameters:
  requiredType - the type of the beans to look up a Map of bean names and bean instances that match the required type,or null if none found
throws:
  BeansException - in case of errors



getInstantiationStrategy
protected InstantiationStrategy getInstantiationStrategy()(Code)
Return the instantiation strategy to use for creating bean instances.



getTypeForFactoryBean
protected Class getTypeForFactoryBean(String beanName, RootBeanDefinition mbd)(Code)
This implementation checks the FactoryBean's getObjectType method on a plain instance of the FactoryBean, without bean properties applied yet. If this doesn't return a type yet, a full creation of the FactoryBean is used as fallback (through delegation to the superclass's implementation).

The shortcut check for a FactoryBean is only applied in case of a singleton FactoryBean. If the FactoryBean instance itself is not kept as singleton, it will be fully created to check the type of its exposed object.




getTypeForFactoryMethod
protected Class getTypeForFactoryMethod(String beanName, RootBeanDefinition mbd)(Code)
Determine the bean type for the given bean definition which is based on a factory method. Only called if there is no singleton instance registered for the target bean already.

This implementation determines the type matching AbstractAutowireCapableBeanFactory.createBean 's different creation strategies. As far as possible, we'll perform static type checking to avoid creation of the target bean.
Parameters:
  beanName - the name of the bean (for error handling purposes)
Parameters:
  mbd - the merged bean definition for the bean the type for the bean if determinable, or null else
See Also:   AbstractAutowireCapableBeanFactory.createBean




ignoreDependencyInterface
public void ignoreDependencyInterface(Class ifc)(Code)
Ignore the given dependency interface for autowiring.

This will typically be used by application contexts to register dependencies that are resolved in other ways, like BeanFactory through BeanFactoryAware or ApplicationContext through ApplicationContextAware.

By default, only the BeanFactoryAware interface is ignored. For further types to ignore, invoke this method for each type.
See Also:   org.springframework.beans.factory.BeanFactoryAware
See Also:   org.springframework.context.ApplicationContextAware




ignoreDependencyType
public void ignoreDependencyType(Class type)(Code)
Ignore the given dependency type for autowiring: for example, String. Default is none.



initializeBean
public Object initializeBean(Object existingBean, String beanName)(Code)



initializeBean
protected Object initializeBean(String beanName, Object bean, RootBeanDefinition mbd)(Code)
Initialize the given bean instance, applying factory callbacks as well as init methods and bean post processors.

Called from AbstractAutowireCapableBeanFactory.createBean for traditionally defined beans, and from AbstractAutowireCapableBeanFactory.initializeBean for existing bean instances.
Parameters:
  beanName - the bean name in the factory (for debugging purposes)
Parameters:
  bean - the new bean instance we may need to initialize
Parameters:
  mbd - the bean definition that the bean was created with(can also be null, if given an existing bean instance) the initialized bean instance (potentially wrapped)
See Also:   BeanNameAware
See Also:   BeanClassLoaderAware
See Also:   BeanFactoryAware
See Also:   AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization
See Also:   AbstractAutowireCapableBeanFactory.invokeInitMethods
See Also:   AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization




instantiateBean
protected BeanWrapper instantiateBean(String beanName, RootBeanDefinition mbd)(Code)
Instantiate the given bean using its default constructor.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean BeanWrapper for the new instance



instantiateUsingFactoryMethod
protected BeanWrapper instantiateUsingFactoryMethod(String beanName, RootBeanDefinition mbd, Object[] explicitArgs)(Code)
Instantiate the bean using a named factory method. The method may be static, if the mbd parameter specifies a class, rather than a factoryBean, or an instance variable on a factory object itself configured using Dependency Injection.

Implementation requires iterating over the static or instance methods with the name specified in the RootBeanDefinition (the method may be overloaded) and trying to match with the parameters. We don't have the types attached to constructor args, so trial and error is the only way to go here. The explicitArgs array may contain argument values passed in programmatically via the corresponding getBean method.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean
Parameters:
  explicitArgs - argument values passed in programmatically via the getBeanmethod, or null if none (-> use constructor argument values from bean definition) BeanWrapper for the new instance
See Also:   AbstractAutowireCapableBeanFactory.getBean(String,Object[])




invokeCustomInitMethod
protected void invokeCustomInitMethod(String beanName, Object bean, String initMethodName, boolean enforceInitMethod) throws Throwable(Code)
Invoke the specified custom init method on the given bean. Called by invokeInitMethods.

Can be overridden in subclasses for custom resolution of init methods with arguments.
Parameters:
  beanName - the bean name in the factory (for debugging purposes)
Parameters:
  bean - the new bean instance we may need to initialize
Parameters:
  initMethodName - the name of the custom init method
Parameters:
  enforceInitMethod - indicates whether the defined init method needs to exist
See Also:   AbstractAutowireCapableBeanFactory.invokeInitMethods




invokeInitMethods
protected void invokeInitMethods(String beanName, Object bean, RootBeanDefinition mbd) throws Throwable(Code)
Give a bean a chance to react now all its properties are set, and a chance to know about its owning bean factory (this object). This means checking whether the bean implements InitializingBean or defines a custom init method, and invoking the necessary callback(s) if it does.
Parameters:
  beanName - the bean name in the factory (for debugging purposes)
Parameters:
  bean - the new bean instance we may need to initialize
Parameters:
  mbd - the merged bean definition that the bean was created with(can also be null, if given an existing bean instance)
throws:
  Throwable - if thrown by init methods or by the invocation process
See Also:   AbstractAutowireCapableBeanFactory.invokeCustomInitMethod



isExcludedFromDependencyCheck
protected boolean isExcludedFromDependencyCheck(PropertyDescriptor pd)(Code)
Determine whether the given bean property is excluded from dependency checks.

This implementation excludes properties defined by CGLIB and properties whose type matches an ignored dependency type or which are defined by an ignored dependency interface.
Parameters:
  pd - the PropertyDescriptor of the bean property whether the bean property is excluded
See Also:   AbstractAutowireCapableBeanFactory.ignoreDependencyType(Class)
See Also:   AbstractAutowireCapableBeanFactory.ignoreDependencyInterface(Class)




populateBean
protected void populateBean(String beanName, RootBeanDefinition mbd, BeanWrapper bw)(Code)
Populate the bean instance in the given BeanWrapper with the property values from the bean definition.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the bean definition for the bean
Parameters:
  bw - BeanWrapper with bean instance



postProcessObjectFromFactoryBean
protected Object postProcessObjectFromFactoryBean(Object object, String beanName)(Code)
Applies the postProcessAfterInitialization callback of all registered BeanPostProcessors, giving them a chance to post-process the object obtained from FactoryBeans (for example, to auto-proxy them).
See Also:   AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization



predictBeanType
protected Class predictBeanType(String beanName, RootBeanDefinition mbd)(Code)
Predict the eventual bean type for the given bean.
Parameters:
  beanName - the name of the bean
Parameters:
  mbd - the merged bean definition to determine the type for the type of the bean, or null if not predictable



removeSingleton
protected void removeSingleton(String beanName)(Code)
Overridden to clear FactoryBean instance cache as well.



setAllowCircularReferences
public void setAllowCircularReferences(boolean allowCircularReferences)(Code)
Set whether to allow circular references between beans - and automatically try to resolve them.

Note that circular reference resolution means that one of the involved beans will receive a reference to another bean that is not fully initialized yet. This can lead to subtle and not-so-subtle side effects on initialization; it does work fine for many scenarios, though.

Default is "true". Turn this off to throw an exception when encountering a circular reference, disallowing them completely.

NOTE: It is generally recommended to not rely on circular references between your beans. Refactor your application logic to have the two beans involved delegate to a third bean that encapsulates their common logic.




setAllowRawInjectionDespiteWrapping
public void setAllowRawInjectionDespiteWrapping(boolean allowRawInjectionDespiteWrapping)(Code)
Set whether to allow the raw injection of a bean instance into some other bean's property, despite the injected bean eventually getting wrapped (for example, through AOP auto-proxying).

This will only be used as a last resort in case of a circular reference that cannot be resolved otherwise: essentially, preferring a raw instance getting injected over a failure of the entire bean wiring process.

Default is "false", as of Spring 2.0. Turn this on to allow for non-wrapped raw beans injected into some of your references, which was Spring 1.2's (arguably unclean) default behavior.

NOTE: It is generally recommended to not rely on circular references between your beans, in particular with auto-proxying involved.
See Also:   AbstractAutowireCapableBeanFactory.setAllowCircularReferences




setInstantiationStrategy
public void setInstantiationStrategy(InstantiationStrategy instantiationStrategy)(Code)
Set the instantiation strategy to use for creating bean instances. Default is CglibSubclassingInstantiationStrategy.
See Also:   CglibSubclassingInstantiationStrategy



unsatisfiedNonSimpleProperties
protected String[] unsatisfiedNonSimpleProperties(RootBeanDefinition mbd, BeanWrapper bw)(Code)
Return an array of non-simple bean properties that are unsatisfied. These are probably unsatisfied references to other beans in the factory. Does not include simple properties like primitives or Strings.
Parameters:
  mbd - the merged bean definition the bean was created with
Parameters:
  bw - the BeanWrapper the bean was created with an array of bean property names
See Also:   org.springframework.beans.BeanUtils.isSimpleProperty



Methods inherited from org.springframework.beans.factory.support.AbstractBeanFactory
public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor)(Code)(Java Doc)
public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar)(Code)(Java Doc)
protected void afterPrototypeCreation(String beanName)(Code)(Java Doc)
protected void beforePrototypeCreation(String beanName)(Code)(Java Doc)
protected void checkMergedBeanDefinition(RootBeanDefinition mbd, String beanName, Object[] args) throws BeanDefinitionStoreException(Code)(Java Doc)
protected void clearMergedBeanDefinition(String beanName)(Code)(Java Doc)
public boolean containsBean(String name)(Code)(Java Doc)
abstract protected boolean containsBeanDefinition(String beanName)(Code)(Java Doc)
public boolean containsLocalBean(String name)(Code)(Java Doc)
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory)(Code)(Java Doc)
abstract protected Object createBean(String beanName, RootBeanDefinition mbd, Object[] args) throws BeanCreationException(Code)(Java Doc)
public void destroyBean(String beanName, Object beanInstance)(Code)(Java Doc)
protected void destroyBean(String beanName, Object beanInstance, RootBeanDefinition mbd)(Code)(Java Doc)
public void destroyScopedBean(String beanName)(Code)(Java Doc)
public String[] getAliases(String name)(Code)(Java Doc)
public Object getBean(String name) throws BeansException(Code)(Java Doc)
public Object getBean(String name, Class requiredType) throws BeansException(Code)(Java Doc)
public Object getBean(String name, Object[] args) throws BeansException(Code)(Java Doc)
public Object getBean(String name, Class requiredType, Object[] args) throws BeansException(Code)(Java Doc)
public ClassLoader getBeanClassLoader()(Code)(Java Doc)
abstract protected BeanDefinition getBeanDefinition(String beanName) throws BeansException(Code)(Java Doc)
public int getBeanPostProcessorCount()(Code)(Java Doc)
public List getBeanPostProcessors()(Code)(Java Doc)
public Map getCustomEditors()(Code)(Java Doc)
public RootBeanDefinition getMergedBeanDefinition(String beanName) throws BeansException(Code)(Java Doc)
protected RootBeanDefinition getMergedBeanDefinition(String beanName, boolean includingAncestors) throws BeansException(Code)(Java Doc)
protected RootBeanDefinition getMergedBeanDefinition(String beanName, BeanDefinition bd) throws BeanDefinitionStoreException(Code)(Java Doc)
protected RootBeanDefinition getMergedBeanDefinition(String beanName, BeanDefinition bd, BeanDefinition containingBd) throws BeanDefinitionStoreException(Code)(Java Doc)
protected Object getObjectForBeanInstance(Object beanInstance, String name, RootBeanDefinition mbd)(Code)(Java Doc)
public BeanFactory getParentBeanFactory()(Code)(Java Doc)
public Set getPropertyEditorRegistrars()(Code)(Java Doc)
public Scope getRegisteredScope(String scopeName)(Code)(Java Doc)
public String[] getRegisteredScopeNames()(Code)(Java Doc)
public Class getType(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
public TypeConverter getTypeConverter()(Code)(Java Doc)
protected Class getTypeForFactoryBean(String beanName, RootBeanDefinition mbd)(Code)(Java Doc)
protected Class getTypeForFactoryBean(FactoryBean factoryBean)(Code)(Java Doc)
protected boolean hasDestructionAwareBeanPostProcessors()(Code)(Java Doc)
protected boolean hasInstantiationAwareBeanPostProcessors()(Code)(Java Doc)
protected void initBeanWrapper(BeanWrapper bw)(Code)(Java Doc)
protected boolean isAlias(String beanName)(Code)(Java Doc)
protected boolean isBeanClassMatch(String beanName, RootBeanDefinition mbd, Class targetType) throws CannotLoadBeanClassException(Code)(Java Doc)
protected boolean isBeanNameInUse(String beanName)(Code)(Java Doc)
public boolean isCacheBeanMetadata()(Code)(Java Doc)
public boolean isCurrentlyInCreation(String beanName)(Code)(Java Doc)
public boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
final protected boolean isPrototypeCurrentlyInCreation(String beanName)(Code)(Java Doc)
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException(Code)(Java Doc)
public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException(Code)(Java Doc)
protected String originalBeanName(String name)(Code)(Java Doc)
protected Object postProcessObjectFromFactoryBean(Object object, String beanName) throws BeansException(Code)(Java Doc)
protected Class predictBeanType(String beanName, RootBeanDefinition mbd)(Code)(Java Doc)
public void registerAlias(String beanName, String alias) throws BeanDefinitionStoreException(Code)(Java Doc)
public void registerCustomEditor(Class requiredType, PropertyEditor propertyEditor)(Code)(Java Doc)
protected void registerCustomEditors(PropertyEditorRegistry registry)(Code)(Java Doc)
protected void registerDisposableBeanIfNecessary(String beanName, Object bean, RootBeanDefinition mbd)(Code)(Java Doc)
public void registerScope(String scopeName, Scope scope)(Code)(Java Doc)
protected void removeSingleton(String beanName)(Code)(Java Doc)
protected boolean requiresDestruction(Object bean, RootBeanDefinition mbd)(Code)(Java Doc)
protected Class resolveBeanClass(RootBeanDefinition mbd, String beanName) throws CannotLoadBeanClassException(Code)(Java Doc)
public void setBeanClassLoader(ClassLoader beanClassLoader)(Code)(Java Doc)
public void setCacheBeanMetadata(boolean cacheBeanMetadata)(Code)(Java Doc)
public void setParentBeanFactory(BeanFactory parentBeanFactory)(Code)(Java Doc)
protected String transformedBeanName(String name)(Code)(Java Doc)

Fields inherited from org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
protected void addSingleton(String beanName, Object singletonObject)(Code)(Java Doc)
protected void afterSingletonCreation(String beanName)(Code)(Java Doc)
protected void beforeSingletonCreation(String beanName)(Code)(Java Doc)
public boolean containsSingleton(String beanName)(Code)(Java Doc)
protected void destroyBean(String beanName, DisposableBean bean)(Code)(Java Doc)
public void destroySingleton(String beanName)(Code)(Java Doc)
public void destroySingletons()(Code)(Java Doc)
protected Set getDependentBeans(String beanName)(Code)(Java Doc)
public Object getSingleton(String beanName)(Code)(Java Doc)
public Object getSingleton(String beanName, ObjectFactory singletonFactory)(Code)(Java Doc)
public int getSingletonCount()(Code)(Java Doc)
final protected Object getSingletonMutex()(Code)(Java Doc)
public String[] getSingletonNames()(Code)(Java Doc)
protected boolean hasDependentBean(String beanName)(Code)(Java Doc)
final public boolean isSingletonCurrentlyInCreation(String beanName)(Code)(Java Doc)
public void registerDependentBean(String beanName, String dependentBeanName)(Code)(Java Doc)
public void registerDisposableBean(String beanName, DisposableBean bean)(Code)(Java Doc)
public void registerSingleton(String beanName, Object singletonObject) throws IllegalStateException(Code)(Java Doc)
protected void removeSingleton(String beanName)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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