Skip to content
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

Invoke default methods in dynamic proxies automatically #28495

Open
sbrannen opened this issue May 20, 2022 · 1 comment
Open

Invoke default methods in dynamic proxies automatically #28495

sbrannen opened this issue May 20, 2022 · 1 comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

Overview

See #28491 for background information.

In JDK dynamic proxies created by Spring AOP, we could potentially introduce support for automatically invoking default methods (or make it easier via a utility).

Available Java APIs

  • java.lang.reflect.Method.isDefault()
  • java.lang.reflect.InvocationHandler.invokeDefault(Object, Method, Object...)
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels May 20, 2022
@sbrannen sbrannen added this to the 6.0.0-M5 milestone May 20, 2022
@sbrannen sbrannen self-assigned this Jun 7, 2022
@sbrannen sbrannen modified the milestones: 6.0.0-M5, 6.0.0-M6 Jun 7, 2022
@sbrannen sbrannen removed their assignment Jul 12, 2022
@sbrannen sbrannen modified the milestones: 6.0.0-M6, 6.0.0-RC1 Aug 29, 2022
@sbrannen sbrannen modified the milestones: 6.0.0-RC1, 6.0.x Oct 10, 2022
@jhoeller jhoeller modified the milestones: 6.0.x, 6.1.x Mar 7, 2023
@sbrannen sbrannen self-assigned this Jun 19, 2023
@jhoeller jhoeller modified the milestones: 6.1.x, 6.x Backlog Nov 9, 2023
injae-kim added a commit to injae-kim/spring-framework that referenced this issue Jan 12, 2024
injae-kim added a commit to injae-kim/spring-framework that referenced this issue Jan 12, 2024
@injae-kim
Copy link
Contributor

injae-kim commented Jan 12, 2024

In JDK dynamic proxies created by Spring AOP, we could potentially introduce support for automatically invoking default methods
(or make it easier via a utility).

We can add some class to support automatically invoking default method,
but I found that only 2 proxies (HttpServiceProxyFactory, RSocketServiceProxyFactory) invoke default method now 😄

So I think introducing some utility to invoke default method is enough for now!
We can easily improve it later.

I created simple PR #32018 🙇
If my PR is not what you think, please close it or share your idea~! thank you!

@sbrannen sbrannen removed their assignment Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants