Set scoped proxy role to same role as target definition

This allows scoped proxy definitions to override regular application bean definitions (again).

Issue: SPR-11229
This commit is contained in:
Juergen Hoeller
2013-12-16 21:47:35 +01:00
parent e2f85fc1d0
commit 61a3d04e91
2 changed files with 16 additions and 1 deletions

View File

@@ -58,7 +58,7 @@ public abstract class ScopedProxyUtils {
proxyDefinition.setDecoratedDefinition(new BeanDefinitionHolder(targetDefinition, targetBeanName));
proxyDefinition.setOriginatingBeanDefinition(targetDefinition);
proxyDefinition.setSource(definition.getSource());
proxyDefinition.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
proxyDefinition.setRole(targetDefinition.getRole());
proxyDefinition.getPropertyValues().add("targetBeanName", targetBeanName);
if (proxyTargetClass) {