Package org.springframework.aop.scope
Class ScopedProxyUtils
java.lang.Object
org.springframework.aop.scope.ScopedProxyUtils
Utility class for creating a scoped proxy.
Used by ScopedProxyBeanDefinitionDecorator and ClassPathBeanDefinitionScanner.
- Since:
- 2.5
- Author:
- Mark Fisher, Juergen Hoeller, Rob Harrop, Sam Brannen
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
ScopedProxyUtils
public ScopedProxyUtils()
-
-
Method Details
-
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.- Parameters:
definition
- the original bean definitionregistry
- the bean definition registryproxyTargetClass
- whether to create a target class proxy- Returns:
- the scoped proxy definition
- See Also:
-
getTargetBeanName
Generate the bean name that is used within the scoped proxy to reference the target bean.- Parameters:
originalBeanName
- the original name of bean- Returns:
- the generated bean to be used to reference the target bean
- See Also:
-
getOriginalBeanName
Get the original bean name for the provided target bean name.- Parameters:
targetBeanName
- the target bean name for the scoped proxy- Returns:
- the original bean name
- Throws:
IllegalArgumentException
- if the supplied bean name does not refer to the target of a scoped proxy- Since:
- 5.1.10
- See Also:
-
isScopedTarget
Determine if thebeanName
is the name of a bean that references the target bean within a scoped proxy.- Since:
- 4.1.4
-