类 LazyInitTargetSourceCreator

java.lang.Object
cn.taketoday.aop.framework.autoproxy.target.AbstractBeanFactoryTargetSourceCreator
cn.taketoday.aop.framework.autoproxy.target.LazyInitTargetSourceCreator
所有已实现的接口:
TargetSourceCreator, Aware, BeanFactoryAware, DisposableBean

public class LazyInitTargetSourceCreator extends AbstractBeanFactoryTargetSourceCreator
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.

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 an autodetected infrastructure bean in an XML application context definition:

 <bean class="cn.taketoday.aop.proxy.BeanNameAutoProxyCreator">
   <property name="beanNames" value="*" /> <!-- apply to all beans -->
   <property name="customTargetSourceCreators">
     <list>
       <bean class="cn.taketoday.aop.proxy.target.LazyInitTargetSourceCreator" />
     </list>
   </property>
 </bean>

 <bean id="myLazyInitBean" class="mypackage.MyBeanClass" lazy-init="true">
   <!-- ... -->
 </bean>
从以下版本开始:
4.0 2021/12/13 22:22
作者:
Juergen Hoeller, Sam Brannen, Harry Yang
另请参阅:
  • 构造器详细资料

    • LazyInitTargetSourceCreator

      public LazyInitTargetSourceCreator()
  • 方法详细资料