Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

fix metrics field injection into AOP-advised beans #46

Conversation

adammelliott
Copy link
Contributor

When injecting metrics into annotated fields of AOP proxied beans, the
bean post processor was attempting to inject the values into the proxy
instance, not the underlying bean. Since the fields in question didn't
exist, this would cause an error. Instead, perform the injection at an
earlier phase of bean post-processing, which targets the underlying
bean, not the proxy wrapper.

When injecting metrics into annotated fields of AOP proxied beans, the
bean post processor was attempting to inject the values into the proxy
instance, not the underlying bean.  Since the fields in question didn't
exist, this would cause an error.  Instead, perform the injection at an
earlier phase of bean post-processing, which targets the underlying
bean, not the proxy wrapper.
@adammelliott
Copy link
Contributor Author

The alternative is, of course, to use CGLIB class-based proxies, but I prefer JDK interface proxies where possible.

ryantenney added a commit that referenced this pull request Nov 14, 2013
…initialization

Fix metric injection into AOP-advised beans
@ryantenney ryantenney merged commit 285e1c0 into ryantenney:master Nov 14, 2013
@ryantenney
Copy link
Owner

This is excellent! Thanks so much!

@adammelliott adammelliott deleted the inject-fields-during-before-initialization branch November 14, 2013 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants