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.BeanFactoryAwareMethodInterceptor
Intercepts the invocation of any
BeanFactoryAware.setBeanFactory(BeanFactory) on @Configuration
class instances for the purpose of recording the BeanFactory . |
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 interface |
ConfigurationClassEnhancer.ConditionalCallback
Conditional
Callback . |
private static class |
ConfigurationClassEnhancer.ConditionalCallbackFilter
A
CallbackFilter that works by interrogating Callback s in the order
that they are defined via ConfigurationClassEnhancer.ConditionalCallback . |
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.
|
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
BEAN_FACTORY_FIELD |
private static ConfigurationClassEnhancer.ConditionalCallbackFilter |
CALLBACK_FILTER |
private static Callback[] |
CALLBACKS |
private static Log |
logger |
Constructor and Description |
---|
ConfigurationClassEnhancer() |
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 Callback[] CALLBACKS
private static final ConfigurationClassEnhancer.ConditionalCallbackFilter CALLBACK_FILTER
private static final java.lang.String BEAN_FACTORY_FIELD
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.