public abstract class ScopedProxyUtils extends Object
Used by ScopedProxyBeanDefinitionDecorator and ClassPathBeanDefinitionScanner.
Constructor and Description |
---|
ScopedProxyUtils() |
Modifier and Type | Method and Description |
---|---|
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)
Specify if the
beanName is the name of a bean that references the target
bean within a scoped proxy. |
public static BeanDefinitionHolder createScopedProxy(BeanDefinitionHolder definition, BeanDefinitionRegistry registry, boolean proxyTargetClass)
definition
- the original bean definitionregistry
- the bean definition registryproxyTargetClass
- whether to create a target class proxygetTargetBeanName(String)
,
getOriginalBeanName(String)
public static String getTargetBeanName(String originalBeanName)
originalBeanName
- the original name of beangetOriginalBeanName(String)
public static String getOriginalBeanName(@Nullable String targetBeanName)
targetBeanName
- the target bean name for the scoped proxyIllegalArgumentException
- if the supplied bean name does not refer
to the target of a scoped proxygetTargetBeanName(String)
,
isScopedTarget(String)