Class CglibSubclassingInstantiationStrategy
java.lang.Object
org.springframework.beans.factory.support.SimpleInstantiationStrategy
org.springframework.beans.factory.support.CglibSubclassingInstantiationStrategy
- All Implemented Interfaces:
InstantiationStrategy
Default object instantiation strategy for use in BeanFactories.
Uses CGLIB to generate subclasses dynamically if methods need to be overridden by the container to implement Method Injection.
- Since:
- 1.1
- Author:
- Rod Johnson, Juergen Hoeller, Sam Brannen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>getActualBeanClass(RootBeanDefinition bd, String beanName, BeanFactory owner) Determine the actual class for the given bean definition, as instantiated at runtime.protected ObjectinstantiateWithMethodInjection(RootBeanDefinition bd, String beanName, BeanFactory owner) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.protected ObjectinstantiateWithMethodInjection(RootBeanDefinition bd, String beanName, BeanFactory owner, Constructor<?> ctor, Object... args) Subclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition.Methods inherited from class org.springframework.beans.factory.support.SimpleInstantiationStrategy
getCurrentlyInvokedFactoryMethod, instantiate, instantiate, instantiate, setCurrentlyInvokedFactoryMethod
-
Constructor Details
-
CglibSubclassingInstantiationStrategy
public CglibSubclassingInstantiationStrategy()
-
-
Method Details
-
instantiateWithMethodInjection
protected Object instantiateWithMethodInjection(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner) Description copied from class:SimpleInstantiationStrategySubclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use a no-arg constructor.- Overrides:
instantiateWithMethodInjectionin classSimpleInstantiationStrategy
-
instantiateWithMethodInjection
protected Object instantiateWithMethodInjection(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner, @Nullable Constructor<?> ctor, Object... args) Description copied from class:SimpleInstantiationStrategySubclasses can override this method, which is implemented to throw UnsupportedOperationException, if they can instantiate an object with the Method Injection specified in the given RootBeanDefinition. Instantiation should use the given constructor and parameters.- Overrides:
instantiateWithMethodInjectionin classSimpleInstantiationStrategy
-
getActualBeanClass
public Class<?> getActualBeanClass(RootBeanDefinition bd, @Nullable String beanName, BeanFactory owner) Description copied from interface:InstantiationStrategyDetermine the actual class for the given bean definition, as instantiated at runtime.
-