程序包 infra.aop.scope
类 ScopedProxyUtils
java.lang.Object
infra.aop.scope.ScopedProxyUtils
Utility class for creating a scoped proxy.
Used by ScopedProxyBeanDefinitionDecorator and ClassPathBeanDefinitionScanner.
- 从以下版本开始:
- 4.0 2022/3/7 21:16
- 作者:
- Mark Fisher, Juergen Hoeller, Rob Harrop, Sam Brannen, Harry Yang
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static infra.beans.factory.config.BeanDefinitionHoldercreateScopedProxy(infra.beans.factory.config.BeanDefinitionHolder definition, infra.beans.factory.support.BeanDefinitionRegistry registry, boolean proxyTargetClass) Generate a scoped proxy for the supplied target bean, registering the target bean with an internal name and setting 'targetBeanName' on the scoped proxy.static StringgetOriginalBeanName(String targetBeanName) Get the original bean name for the provided target bean name.static StringgetTargetBeanName(String originalBeanName) Generate the bean name that is used within the scoped proxy to reference the target bean.static booleanisScopedTarget(String beanName) Determine if thebeanNameis the name of a bean that references the target bean within a scoped proxy.
-
字段详细资料
-
TARGET_NAME_PREFIX
- 另请参阅:
-
TARGET_NAME_PREFIX_LENGTH
private static final int TARGET_NAME_PREFIX_LENGTH
-
-
构造器详细资料
-
ScopedProxyUtils
public ScopedProxyUtils()
-
-
方法详细资料
-
createScopedProxy
public static infra.beans.factory.config.BeanDefinitionHolder createScopedProxy(infra.beans.factory.config.BeanDefinitionHolder definition, infra.beans.factory.support.BeanDefinitionRegistry registry, boolean proxyTargetClass) Generate a scoped proxy for the supplied target bean, registering the target bean with an internal name and setting 'targetBeanName' on the scoped proxy.- 参数:
definition- the original bean definitionregistry- the bean definition registryproxyTargetClass- whether to create a target class proxy- 返回:
- the scoped proxy definition
- 另请参阅:
-
getTargetBeanName
Generate the bean name that is used within the scoped proxy to reference the target bean.- 参数:
originalBeanName- the original name of bean- 返回:
- the generated bean to be used to reference the target bean
- 另请参阅:
-
getOriginalBeanName
Get the original bean name for the provided target bean name.- 参数:
targetBeanName- the target bean name for the scoped proxy- 返回:
- the original bean name
- 抛出:
IllegalArgumentException- if the supplied bean name does not refer to the target of a scoped proxy- 另请参阅:
-
isScopedTarget
Determine if thebeanNameis the name of a bean that references the target bean within a scoped proxy.
-