Update Javadoc for LazyInitTargetSourceCreator

See gh-24915
This commit is contained in:
Sam Brannen
2020-05-12 12:53:35 +02:00
parent c6e2a5ea33
commit e8335c94d5

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,30 +23,32 @@ import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.lang.Nullable;
/**
* TargetSourceCreator that enforces a LazyInitTargetSource for each bean
* that is defined as "lazy-init". This will lead to a proxy created for
* each of those beans, allowing to fetch a reference to such a bean
* without actually initializing the target bean instance.
* {@code TargetSourceCreator} that enforces a {@link LazyInitTargetSource} for
* each bean that is defined as "lazy-init". This will lead to a proxy created for
* each of those beans, allowing to fetch a reference to such a bean without
* actually initializing the target bean instance.
*
* <p>To be registered as custom TargetSourceCreator for an auto-proxy creator,
* in combination with custom interceptors for specific beans or for the
* creation of lazy-init proxies only. For example, as autodetected
* <p>To be registered as custom {@code TargetSourceCreator} for an auto-proxy
* creator, in combination with custom interceptors for specific beans or for the
* creation of lazy-init proxies only. For example, as an autodetected
* infrastructure bean in an XML application context definition:
*
* <pre class="code">
* &lt;bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator"&gt;
* &lt;property name="beanNames" value="*" /&gt; &lt;!-- apply to all beans --&gt;
* &lt;property name="customTargetSourceCreators"&gt;
* &lt;list&gt;
* &lt;bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator"/&gt;
* &lt;bean class="org.springframework.aop.framework.autoproxy.target.LazyInitTargetSourceCreator" /&gt;
* &lt;/list&gt;
* &lt;/property&gt;
* &lt;/bean&gt;
*
* &lt;bean id="myLazyInitBean" class="mypackage.MyBeanClass" lazy-init="true"&gt;
* ...
* &lt;!-- ... --&gt;
* &lt;/bean&gt;</pre>
*
* @author Juergen Hoeller
* @author Sam Brannen
* @since 1.2
* @see org.springframework.beans.factory.config.BeanDefinition#isLazyInit
* @see org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator#setCustomTargetSourceCreators