public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationStrategy
Uses CGLIB to generate subclasses dynamically if methods need to be overridden by the container to implement Method Injection.
Modifier and Type | Class and Description |
---|---|
private static class |
CglibSubclassingInstantiationStrategy.CglibIdentitySupport
Class providing hashCode and equals methods required by CGLIB to
ensure that CGLIB doesn't generate a distinct class per bean.
|
private static class |
CglibSubclassingInstantiationStrategy.CglibSubclassCreator
An inner class created for historical reasons to avoid external CGLIB dependency
in Spring versions earlier than 3.2.
|
private static class |
CglibSubclassingInstantiationStrategy.ClassLoaderAwareGeneratorStrategy
CGLIB GeneratorStrategy variant which exposes the application ClassLoader
as thread context ClassLoader for the time of class generation
(in order for ASM to pick it up when doing common superclass resolution).
|
private static class |
CglibSubclassingInstantiationStrategy.LookupOverrideMethodInterceptor
CGLIB MethodInterceptor to override methods, replacing them with an
implementation that returns a bean looked up in the container.
|
private static class |
CglibSubclassingInstantiationStrategy.MethodOverrideCallbackFilter
CGLIB callback for filtering method interception behavior.
|
private static class |
CglibSubclassingInstantiationStrategy.ReplaceOverrideMethodInterceptor
CGLIB MethodInterceptor to override methods, replacing them with a call
to a generic MethodReplacer.
|
Modifier and Type | Field and Description |
---|---|
private static int |
LOOKUP_OVERRIDE
Index in the CGLIB callback array for a method that should
be overridden to provide method lookup.
|
private static int |
METHOD_REPLACER
Index in the CGLIB callback array for a method that should
be overridden using generic method replacer functionality.
|
private static int |
PASSTHROUGH
Index in the CGLIB callback array for passthrough behavior,
in which case the subclass won't override the original class.
|
Constructor and Description |
---|
CglibSubclassingInstantiationStrategy() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
instantiateWithMethodInjection(RootBeanDefinition bd,
java.lang.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 java.lang.Object |
instantiateWithMethodInjection(RootBeanDefinition bd,
java.lang.String beanName,
BeanFactory owner,
java.lang.reflect.Constructor<?> ctor,
java.lang.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.
|
getCurrentlyInvokedFactoryMethod, instantiate, instantiate, instantiate
private static final int PASSTHROUGH
private static final int LOOKUP_OVERRIDE
private static final int METHOD_REPLACER
public CglibSubclassingInstantiationStrategy()
protected java.lang.Object instantiateWithMethodInjection(RootBeanDefinition bd, java.lang.String beanName, BeanFactory owner)
SimpleInstantiationStrategy
instantiateWithMethodInjection
in class SimpleInstantiationStrategy
protected java.lang.Object instantiateWithMethodInjection(RootBeanDefinition bd, java.lang.String beanName, BeanFactory owner, java.lang.reflect.Constructor<?> ctor, java.lang.Object... args)
SimpleInstantiationStrategy
instantiateWithMethodInjection
in class SimpleInstantiationStrategy