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

Proposal for easing the development of annotation driven static method advices and pointcuts [SPR-14227] #18801

Closed
spring-issuemaster opened this issue Apr 27, 2016 · 4 comments

Comments

@spring-issuemaster
Copy link
Collaborator

@spring-issuemaster spring-issuemaster commented Apr 27, 2016

László Csontos opened SPR-14227 and commented

I've had to implement usage tracking of some business-level service methods. For accomplishing this, there's an annotation defined @LogUsage(type = UsageTypes.SOME_TYPE) to match target methods and an advice which intercepts calls to track.

It's important to note the advice need the know the parameter of the annotation when method calls get intercepted.

I saw examples in Aspect Oriented Programming with Spring how the annotation's properties can be supplied to aspects, however doing the same with the standard Spring AOP wasn't that straightforward.

What I wanted to achieve resembled to the logic of NameMatchMethodPointcutAdvisor, so I sub-classed AbstractGenericPointcutAdvisor to AnnotationMatchMethodPointcutAdvisor, implemented an annotation driven version of it and added a custom advice for logging the usage.

I'd like to contribute my solution to Spring AOP, because I think it eases the development effort needed to implement advices for a custom annotation.

Please let me know what to do you think.


Affects: 4.2.5

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 27, 2016

Juergen Hoeller commented

Sure, let's have a look at it...

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Apr 29, 2016

László Csontos commented

Here we go: #1047

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented May 6, 2016

László Csontos commented

Hey Juergen,

I'm wondering if you've got some bandwidth to review my proposal. Thanks in advance!

Cheers,
László

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

@spring-issuemaster spring-issuemaster commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.