users@jersey.java.net

[Jersey] Re: ClientFilters and AOP

From: Michael Childs <mchilds_at_ghx.com>
Date: Mon, 19 Aug 2013 14:52:36 +0000

Yes I should have addressed that up front. I am attempting to use the class-based AOP approach using CGLIB. I'm now speculating that this wouldn't work with Jersey because even if CGLIB appropriately pulls in all annotations from the parent resource class, jersey will find 2 classes that replicate each other and just choose one. Any illumination would be helpful here as I want to rule out the ability to use class based spring AOP.

From: Colin Vipurs [mailto:zodiaczx6_at_gmail.com]
Sent: Monday, August 19, 2013 2:21 AM
To: users_at_jersey.java.net
Subject: [Jersey] Re: ClientFilters and AOP

How have you tried to get AOP working on your resource methods? It's definitely possible as it's something we have had running for quite some time. There are some caveats which I can't remember in detail, but I'm sure it's something like having to use an Interface and annotations must appear on the interface, not the implementation.

On Sat, Aug 17, 2013 at 12:12 AM, Michael Childs <mchilds_at_ghx.com<mailto:mchilds_at_ghx.com>> wrote:
Hi,

I would like to automatically register ClientRequestFilter and ClientResponseFilter without having to add them to the client. For instance, the ContainerRequestFilter automatically registers and is run for every incoming request. However, I can only get the client filters to run if I directly register them with the client.

Is this possible?

Secondly - is it possible to use AOP on resource methods? All my attempts have failed to use spring AOP with jersey resource methods (to add logging before and after).

Thanks



--
Maybe she awoke to see the roommate's boyfriend swinging from the chandelier wearing a boar's head.
Something which you, I, and everyone else would call "Tuesday", of course.