Issue Details (XML | Word | Printable)

Key: SPR-3576
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Juergen Hoeller
Reporter: Torsten Juergeleit
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Framework

Tooling API: ConfigBeanDefinitionParser does not report BeanDefinition for pointcut attribute

Created: 11/Jun/07 05:57 PM   Updated: 15/Jun/07 10:03 AM   Resolved: 15/Jun/07 10:03 AM
Component/s: SpringCORE
Affects Version/s: 2.0.5, 2.1 M1
Fix Version/s: 2.0.6, 2.1 M3

Time Tracking:
Not Specified


 Description  « Hide

In XmlReaderContext.registerWithGeneratedName() the given BeanDefinition is registered without calling ReaderEventListener..componentRegistered().



Juergen Hoeller added a comment - 12/Jun/07 07:05 AM

Torsten,

XmlReaderContext.registerWithGeneratedName() itself should not and cannot register a component, since that's a facility only available for a specific ParserContext. What we could consider instead is a corresponding registerWithGeneratedName() method on ParserContext, performing the component registration as well.

However, that doesn't seem to be necessary for the usual cases: The specific BeanDefinitionParser implementations are responsible for registering appropriate components, with the bean definitions and generated bean names mentioned in such a specific ComponentDefinition. This is also what the AOP ConfigBeanDefinitionParser does in general.

Since Christian mentioned a problem with ConfigBeanDefinitionParser in particular, I've checked its registration behavior: It didn't register the generated bean definition for a pointcut attribute with any specific component before. I've addressed this through registering a PointcutComponentDefinition for such a pointcut attribute as well.

This ConfigBeanDefinitionParser fix is already in CVS HEAD. Please give it a try and let me know whether it is sufficient for your purposes...

Juergen


Juergen Hoeller added a comment - 15/Jun/07 08:58 AM

As discussed with Christian, I've revised the inline pointcut handling to use inner bean definitions instead of a reference to a generated anonymous bean. This makes the BeanDefinition available as inner bean definition, avoiding the need for a separate PointcutComponentDefinition for an inline pointcut in the first place.

Juergen


Juergen Hoeller added a comment - 15/Jun/07 10:03 AM

Fixed in CVS HEAD (Spring 2.1 M3) as well as mbranch-2-0 (Spring 2.0.6).

Let me know if there are any remaining issues...

Juergen