FactoryBeans returning a @ManagedResource annotated subclass are not auto detected by MBeanExporter [SPR-6540] #11206
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Jeffrey Sinclair opened SPR-6540 and commented
Take the following application context:
with CustomerFactory being defined as:
with the Customer interface being defined as:
with the DefaultCustomer impl being defined as:
Since the autodetect logic only sees the Customer class (which is not annotated with
@ManagedResource
) it does not export the DefaultCustomer instance (which is annotated with@ManagedResource
).There is also the problem that even if the Customer was annotated with
@ManagedResource
the bean definition must be before the MBeanExporter's bean definition for this to work.I added a comment to the following JIRA #10595 describing this issue providing the suggestion that a BeanPostProcessor (perhaps implementing InstantiationAware) would be more suitable for the auto detection logic.
Affects: 3.0 RC3
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: