-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Add support for mixed, fine-grained JDK- and CGLIB-based proxying [SPR-3665] #8346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Jürgen Lukasczyk commented Would it be possible to add some bean definition pre-processor that gets consulted by the proxy factory? Basically a Strategy pattern, with a method To avoid life cycle issues, perhaps you would only allow inner beans from within aop:auto-proxy element. |
Taras Tielkes commented What exactly is the use case for "more fine grained" proxying? The current infrastructure is already confusing and brittle enough, imho. |
Jürgen Lukasczyk commented I have the following use case, connected to JAX-WS and the fact it is relying on annotations (I suppose you can have similar UC w/ other Tiger based technologies):
Confusing & brittle? Not at all, Spring shields you from the complexity of all the stuff it does. I found it quite easy to get the stuff I needed into Spring infrastructure by just overriding one little method in the AutoProxyCreator. |
Jun Yamog commented This would be a good feature. In our case we are using Scala for newer code. This means it defaults to proxy objects as scala classes always implements scala object. If we set proxy target to true to makes the jersey resources register them properly. However old java code that is final classes will not work. Would be good if we can set only cglib for a particular config only. This is kinda related to #13000 a controller or jersey resource that implements a single interface becomes a proxy object. So ClassUtils.getUserClass is unable to get the true object behind as it can only deal with cglib subclasses. |
Mukarram Baig commented We ran into the same scenarios as Jurgen mentioned and wanted to know if there are any workarounds for it? |
Dave Syer commented Spring Cloud and Spring Boot increasingly rub up against this because we provide aspects that are autoconfigured, and their behaviour alters the way user code works in unexpected and unintended ways, depending on whether proxy-target-class=true or false. E.g. with Spring Cloud Sleuth we intercept |
Oliver Drotbohm commented Just recently I ran into this when Boot 1.4 milestones activated |
Bulk closing outdated, unresolved issues. Please, reopen if still relevant. |
Rick Evans opened SPR-3665 and commented
See #8142 for details.
Aye Juergen, I know you tagged that issue as 'expected behaviour', and it was turned into a documentation issue that I addressed, but I (and others evidently) think that the proxying 'feature' of all JDK-proxies or all CGLIB-proxies is too coarse. It should be more fine grained than that, hence my raising this as an enhancement request. I'll have a dig into the code later on today and see exactly what is going on :)
See also http://forum.springframework.org/showthread.php?t=41025
Affects: 2.1 M2
Issue Links:
10 votes, 14 watchers
The text was updated successfully, but these errors were encountered: