程序包 infra.aop.scope
类 ScopedProxyFactoryBean
java.lang.Object
infra.aop.framework.ProxyConfig
infra.aop.scope.ScopedProxyFactoryBean
- 所有已实现的接口:
AopInfrastructureBean,infra.beans.factory.Aware,infra.beans.factory.BeanFactoryAware,infra.beans.factory.FactoryBean<Object>,Serializable
public class ScopedProxyFactoryBean
extends ProxyConfig
implements infra.beans.factory.FactoryBean<Object>, infra.beans.factory.BeanFactoryAware, AopInfrastructureBean
Convenient proxy factory bean for scoped objects.
Proxies created using this factory bean are thread-safe singletons and may be injected into shared objects, with transparent scoping behavior.
Proxies returned by this class implement the ScopedObject interface.
This presently allows for removing the corresponding object from the scope,
seamlessly creating a new instance in the scope on next access.
Please note that the proxies created by this factory are class-based proxies by default. This can be customized through switching the "proxyTargetClass" property to "false".
- 从以下版本开始:
- 4.0
- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明private ObjectThe cached singleton proxy.private final SimpleBeanTargetSourceThe TargetSource that manages scoping.private StringThe name of the target bean.从接口继承的字段 infra.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Class<?>booleanvoidsetBeanFactory(infra.beans.factory.BeanFactory beanFactory) voidsetTargetBeanName(String targetBeanName) Set the name of the bean that is to be scoped.从类继承的方法 infra.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
-
字段详细资料
-
scopedTargetSource
The TargetSource that manages scoping. -
targetBeanName
The name of the target bean. -
proxy
The cached singleton proxy.
-
-
构造器详细资料
-
ScopedProxyFactoryBean
public ScopedProxyFactoryBean()Create a new ScopedProxyFactoryBean instance.
-
-
方法详细资料
-
setTargetBeanName
Set the name of the bean that is to be scoped. -
setBeanFactory
public void setBeanFactory(infra.beans.factory.BeanFactory beanFactory) - 指定者:
setBeanFactory在接口中infra.beans.factory.BeanFactoryAware
-
getObject
- 指定者:
getObject在接口中infra.beans.factory.FactoryBean<Object>
-
getObjectType
- 指定者:
getObjectType在接口中infra.beans.factory.FactoryBean<Object>
-
isSingleton
public boolean isSingleton()- 指定者:
isSingleton在接口中infra.beans.factory.FactoryBean<Object>
-