Description
For JDK dynamic proxies created by Spring's AOP support, SpringProxy
, Advised
, and DecoratingProxy
will often be included in the interfaces that the proxy implements.
Here's an example taken from Spring Integration.
proxyHints
.registerJdkProxy(RequestReplyExchanger.class, SpringProxy.class, Advised.class, DecoratingProxy.class)
.registerJdkProxy(AbstractReplyProducingMessageHandler.RequestHandler.class, SpringProxy.class, Advised.class, DecoratingProxy.class)
.registerJdkProxy(IntegrationFlow.class, SmartLifecycle.class, SpringProxy.class, Advised.class, DecoratingProxy.class);
We should investigate options for simplifying the proxy hint registration for Spring AOP proxies so that users are not required to specify SpringProxy
, Advised
, and DecoratingProxy
.
One option would be to introduce a new registerSpringJdkProxy(...)
method (or similar) in ProxyHints
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 particular registerSpringJdkProxy(...)
variant always registers those 3 particular interfaces to cover common use cases and allow users to continue to use registerJdkProxy(...)
when the additional Spring AOP interfaces differ from that common set of 3.