users@jersey.java.net

[Jersey] Re: ClientFilters and AOP

From: Michael Childs <mchilds_at_ghx.com>
Date: Mon, 19 Aug 2013 16:51:33 +0000

Ok thanks. Have you run into any issues using interfaces? For instance, any issues with subresources, etc?

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

I cannot say with 100% certainty this is the case, but this was the only reason we introduced interfaces onto our resources. Unfortunately I didn't take notes at the time but I do remember we could not get AOP working with CGLIB + Classes. Fairly sure I messaged the group at the time and got nowhere.

Sorry I can't give you a super-concrete answer

On Mon, Aug 19, 2013 at 4:58 PM, Michael Childs <mchilds_at_ghx.com<mailto:mchilds_at_ghx.com>> wrote:
I mean to say that I want to determine with certainty whether class based spring AOP will or won't work with Jersey, because class-based is the common way this company writes all their rest services (they don't use interfaces for jersey REST classes).

From: Colin Vipurs [mailto:zodiaczx6_at_gmail.com<mailto:zodiaczx6_at_gmail.com>]
Sent: Monday, August 19, 2013 9:24 AM

To: users_at_jersey.java.net<mailto:users_at_jersey.java.net>
Subject: [Jersey] Re: ClientFilters and AOP

Did you mean to say you *dont* want to rule out class based spring AOP?

On Mon, Aug 19, 2013 at 3:52 PM, Michael Childs <mchilds_at_ghx.com<mailto:mchilds_at_ghx.com>> wrote:
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<mailto:zodiaczx6_at_gmail.com>]
Sent: Monday, August 19, 2013 2:21 AM
To: users_at_jersey.java.net<mailto: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.
--
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.
--
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.