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

Allow overriding InvocableHandlerMethod.invoke and/or ServletInvocableHandlerMethod.invokeAndHandle in subclasses [SPR-12484] #17090

Closed
spring-projects-issues opened this issue Nov 30, 2014 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 30, 2014

Fabio Tudone opened SPR-12484 and commented

I'm writing a new HandlerMethod dispatching transparently (asynchronously) on lightweight threads and I could reuse most of the existing ServletInvocableHandlerMethod and InvocableHandlerMethod, except invoke is private in the latter and can't be overridden, and invokeAndHandle is final in the first one (and so still can't be overridden).

Would it be possible to ease these restrictions so as to make it easier to reuse existing implementations?


Affects: 4.0.8, 4.1.2

Reference URL: https://github.com/spring-projects/spring-framework/blob/v4.1.2.RELEASE/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java#L212

Issue Links:

Referenced from: commits 2496d68, 90ae073

Backported to: 4.0.9

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've turned the private invoke methods to protected doInvoke methods, and removed the final modifiers from the public invokeAndHandle / invokeForRequest entry point methods in both classes, as well as in the analogous spring-messaging variant of InvocableHandlerMethod.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Fabio Tudone commented

Thanks so much! This will allow me to avoid copy&paste horrors (and associated maintenance nightmares).

@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.1.3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants