-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Simplify hint registration for Spring AOP proxies #28745
Comments
We can't really do that, can we? Spring AOP is higher in the dependency tree. Perhaps something along the lines of RuntimeHintsUtils, but for SpringAopProxy? I am afk but perhaps AopUtils could be used? |
That's a good point. We definitely cannot refer to the
Well, by using the class names we can implement it like this: public ProxyHints registerSpringAopJdkProxy(Class<?>... proxiedInterfaces) {
return registerJdkProxy(jdkProxyHint -> {
jdkProxyHint.proxiedInterfaces(proxiedInterfaces);
jdkProxyHint.proxiedInterfaces(
TypeReference.of("org.springframework.aop.SpringProxy"),
TypeReference.of("org.springframework.aop.framework.Advised"),
TypeReference.of("org.springframework.core.DecoratingProxy"));
});
}
Sure. If we don't want to use the class name based approach I pasted above, we could introduce something along the lines of
Not that I'm aware of. |
That sounds like hiding a conceptual cycle to me.
Are we doing this elsewhere, except in Javadoc links?
How do you mean? I believe |
Team Decision:
|
If that is so important this was discussed, I'd like us to review |
Do you mean you'd like to cross reference If so, I agree that that's a good idea. In any case, feel free to bring it up in the team or open an issue to discuss what you'd like to review. |
Reopening to reduce the scope of this feature to |
For JDK dynamic proxies created by Spring's AOP support,
SpringProxy
,Advised
, andDecoratingProxy
will often be included in the interfaces that the proxy implements.Here's an example taken from Spring Integration.
We should investigate options for simplifying the proxy hint registration for Spring AOP proxies so that users are not required to specify
SpringProxy
,Advised
, andDecoratingProxy
.One option would be to introduce a new
registerSpringJdkProxy(...)
method (or similar) inProxyHints
that automatically registers the required Spring AOP interfaces. Though, it is not always the case that all 3 of those interfaces are implemented by the proxy. So we could document that this particularregisterSpringJdkProxy(...)
variant always registers those 3 particular interfaces to cover common use cases and allow users to continue to useregisterJdkProxy(...)
when the additional Spring AOP interfaces differ from that common set of 3.The text was updated successfully, but these errors were encountered: