@Configuration public class LoadTimeWeavingConfiguration extends java.lang.Object implements ImportAware, BeanClassLoaderAware
@Configuration
class that registers a LoadTimeWeaver
bean.
This configuration class is automatically imported when using the @EnableLoadTimeWeaving
annotation. See @EnableLoadTimeWeaving
Javadoc for
complete usage details.
LoadTimeWeavingConfigurer
,
ConfigurableApplicationContext.LOAD_TIME_WEAVER_BEAN_NAME
Modifier and Type | Field and Description |
---|---|
private java.lang.ClassLoader |
beanClassLoader |
private AnnotationAttributes |
enableLTW |
private LoadTimeWeavingConfigurer |
ltwConfigurer |
Constructor and Description |
---|
LoadTimeWeavingConfiguration() |
Modifier and Type | Method and Description |
---|---|
LoadTimeWeaver |
loadTimeWeaver() |
void |
setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
Callback that supplies the bean <code>class loader</code> to
a bean instance.
|
void |
setImportMetadata(AnnotationMetadata importMetadata)
Set the annotation metadata of the importing @
Configuration class. |
private AnnotationAttributes enableLTW
@Autowired(required=false) private LoadTimeWeavingConfigurer ltwConfigurer
private java.lang.ClassLoader beanClassLoader
public void setImportMetadata(AnnotationMetadata importMetadata)
ImportAware
Configuration
class.setImportMetadata
in interface ImportAware
public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)
BeanClassLoaderAware
Invoked after the population of normal bean properties but
before an initialization callback such as
InitializingBean's
InitializingBean.afterPropertiesSet()
method or a custom init-method.
setBeanClassLoader
in interface BeanClassLoaderAware
beanClassLoader
- the owning class loader; may be null
in
which case a default ClassLoader
must be used, for example
the ClassLoader
obtained via
ClassUtils.getDefaultClassLoader()
@Bean(name="loadTimeWeaver") @Role(value=2) public LoadTimeWeaver loadTimeWeaver()