Skip to content

idref could contain a app context scope to prevent from going to parent bean factory [SPR-3033] #7719

@spring-projects-issues

Description

@spring-projects-issues

Robert Macaulay opened SPR-3033 and commented

In org.springframework.beans.factory.support.AbstractBeanFactory, the method containsBean(String) is called from BeanDefinitionValueResolver.resolveValueIfNecessary, line 116 in 2.0.2.

Was wondering if a scope could be added the the <idref/> to make determination to either call containsBean or containsLocalBean on the beanFactory.

The reason this would be of use would be in BeanNameAutoProxyCreators. We had a case where the beanname idref was a bean defined in the parent application context. Therefore, it was not being proxied by the BeanNameAutoProxyCreator in the child app context, but it wasn't failing since the bean name did in fact exist in the parent.

This would be just an additional security level above idrefs to ensure that there would be no accidental attempts to autoproxy things in the wrong contexts. As far as I could find, there is no mechanism to re-autoproxy in a child context a bean that is included from a parent.


Affects: 2.0.2

Issue Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreIssues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions