users@jersey.java.net

[Jersey] Re: ResourceMethodDispatchAdapter in 2.0?

From: Coda Hale <coda.hale_at_gmail.com>
Date: Tue, 18 Jun 2013 09:04:39 -0700

I have more than a few use cases. :)

First, I have an implementation which records the elapsed time spent inside
the resource method using my Metrics library. I haven't found a way of
doing this which allows me to directly observe the method invocation.

Second, I have an implementation which, if the resource method returns a
Guava Optional without a value, returns a 404. Otherwise, it passes the
Optional's value to the MessageBodyWriter. I tried writing a filter for
this, but then Jersey refuses the resource method because
Optional<Whatever> doesn't have a MessageBodyWriter. I tried writing a
MessageBodyWriter, but trying to inject the MessageBodyWorkers equivalent
was producing dependency cycles in HK2.

Third, I have an implementation which wraps the resource method invocation
in a Hibernate unit of work. Like the first example, this needs to directly
wrap the invocation.

Any advice is appreciated, thank you.


On Tue, Jun 18, 2013 at 8:18 AM, Marek Potociar
<marek.potociar_at_oracle.com>wrote:

> Hi,
>
> We have not ported this API to Jersey 2.0 yet. We would like to first
> understand the use cases where the API is used and see if there is perhaps
> a better way of solving those. Can you please share more details about you
> use case?
>
> Many thanks,
> Marek
>
>
> On Jun 15, 2013, at 1:52 AM, Coda Hale <coda.hale_at_gmail.com> wrote:
>
> I'm trying to find the best way of porting ResourceMethodDispatchAdapter
> implementations, but coming up a bit short.
>
> Any suggestions?
>
> --
> Coda Hale
> http://codahale.com
>
>
>


-- 
Coda Hale
http://codahale.com