春季有春季懒惰的代理工厂吗? [英] Is there a spring lazy proxy factory in Spring?

查看:95
本文介绍了春季有春季懒惰的代理工厂吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Wicket将此设备称为惰性代理工厂.鉴于:

Wicket has this device called a lazy proxy factory. Given:

<property name="foo" ref="beanx"/>

这个想法是自动生成一个代理来代替"beanx",然后仅在实际调用某个方法时以及何时对beanx进行初始化.

the idea is to auto-generate a proxy in place of 'beanx', and then only initialize beanx if and when something actually calls a method on it.

似乎这可能是Spring的核心功能.在某处吗?

It seems as if this might be a core Spring capability. Is it there somewhere?

推荐答案

请参见

See LazyInitTargetSource; that might do what you want. It requires use of lazy-init="true" on the target bean as well, though.

这篇关于春季有春季懒惰的代理工厂吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆