Skip to content

Simplify hint registration for Spring AOP proxies #28745

Closed
@sbrannen

Description

@sbrannen

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)theme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions