类 ScopedProxyUtils
- java.lang.Object
- org.springframework.aop.scope.ScopedProxyUtils
public abstract class ScopedProxyUtils extends Object
Utility class for creating a scoped proxy.Used by ScopedProxyBeanDefinitionDecorator and ClassPathBeanDefinitionScanner.
- 从以下版本开始:
- 2.5
- 作者:
- Mark Fisher, Juergen Hoeller, Rob Harrop, Sam Brannen
构造器概要
构造器 构造器 说明 ScopedProxyUtils()
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static BeanDefinitionHolder
createScopedProxy(BeanDefinitionHolder definition, 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 String
getOriginalBeanName(String targetBeanName)
Get the original bean name for the provided target bean name.static String
getTargetBeanName(String originalBeanName)
Generate the bean name that is used within the scoped proxy to reference the target bean.static boolean
isScopedTarget(String beanName)
Determine if thebeanName
is the name of a bean that references the target bean within a scoped proxy.
构造器详细资料
ScopedProxyUtils
public ScopedProxyUtils()
方法详细资料
createScopedProxy
public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder definition, 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(String)
,getOriginalBeanName(String)
getTargetBeanName
public static String getTargetBeanName(String originalBeanName)
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(String)
getOriginalBeanName
public static String getOriginalBeanName(@Nullable String targetBeanName)
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- 从以下版本开始:
- 5.1.10
- 另请参阅:
getTargetBeanName(String)
,isScopedTarget(String)
isScopedTarget
public static boolean isScopedTarget(@Nullable String beanName)
Determine if thebeanName
is the name of a bean that references the target bean within a scoped proxy.- 从以下版本开始:
- 4.1.4