class ConfigurationClassEnhancer
extends java.lang.Object
Configuration
classes by generating a CGLIB subclass capable of
interacting with the Spring container to respect bean semantics.enhance(java.lang.Class<?>)
,
ConfigurationClassPostProcessor
Modifier and Type | Class and Description |
---|---|
private static class |
ConfigurationClassEnhancer.BeanMethodInterceptor
Intercepts the invocation of any
Bean -annotated methods in order to ensure proper
handling of bean semantics such as scoping and AOP proxying. |
private static class |
ConfigurationClassEnhancer.ConfigurationClassCallbackFilter
CGLIB CallbackFilter implementation that points to BeanMethodInterceptor and
DisposableBeanMethodInterceptor.
|
private static class |
ConfigurationClassEnhancer.DisposableBeanMethodInterceptor
Intercepts the invocation of any
DisposableBean.destroy() on @Configuration
class instances for the purpose of de-registering CGLIB callbacks. |
static interface |
ConfigurationClassEnhancer.EnhancedConfiguration
Marker interface to be implemented by all @Configuration CGLIB subclasses.
|
private static class |
ConfigurationClassEnhancer.GetObjectMethodInterceptor
Intercepts calls to
FactoryBean.getObject() , delegating to calling
BeanFactory.getBean(String) in order to respect caching / scoping. |
Modifier and Type | Field and Description |
---|---|
private static CallbackFilter |
CALLBACK_FILTER |
private static java.lang.Class<?>[] |
CALLBACK_TYPES |
private Callback[] |
callbackInstances |
private static Callback |
DISPOSABLE_BEAN_METHOD_INTERCEPTOR |
private static Log |
logger |
Constructor and Description |
---|
ConfigurationClassEnhancer(ConfigurableBeanFactory beanFactory)
Creates a new
ConfigurationClassEnhancer instance. |
Modifier and Type | Method and Description |
---|---|
private java.lang.Class<?> |
createClass(Enhancer enhancer)
Uses enhancer to generate a subclass of superclass, ensuring that
callbackInstances are registered for the new subclass. |
java.lang.Class<?> |
enhance(java.lang.Class<?> configClass)
Loads the specified class and generates a CGLIB subclass of it equipped with
container-aware callbacks capable of respecting scoping and other bean semantics.
|
private Enhancer |
newEnhancer(java.lang.Class<?> superclass)
Creates a new CGLIB
Enhancer instance. |
private static final Log logger
private static final CallbackFilter CALLBACK_FILTER
private static final Callback DISPOSABLE_BEAN_METHOD_INTERCEPTOR
private static final java.lang.Class<?>[] CALLBACK_TYPES
private final Callback[] callbackInstances
public ConfigurationClassEnhancer(ConfigurableBeanFactory beanFactory)
ConfigurationClassEnhancer
instance.public java.lang.Class<?> enhance(java.lang.Class<?> configClass)
private Enhancer newEnhancer(java.lang.Class<?> superclass)
Enhancer
instance.private java.lang.Class<?> createClass(Enhancer enhancer)
callbackInstances
are registered for the new subclass.