users@jersey.java.net

Intercepting resource invocations

From: Dan Diephouse <dan.diephouse_at_mulesource.com>
Date: Tue, 3 Mar 2009 17:45:26 -0500

We're looking for a way to intercept the invocation of the component inside
Jersey.

Let me explain my use case. In Mule, we create a Jersey based endpoint.
However, sometimes our users only want to define the JAX-RS interface, then
once appropriate databinding is done and a method to invoke is chosen, have
it passed off to Mule. Then mule can route it around, transform it, provide
rules for invocation, etc. And maybe eventually invoke the component.

(Lots of users use this functionality in the JAX-WS world already. The
JAX-WS endpoint inside may perform security and do some databinding, then
it'll forward the POJO which was the soap body around to do other work.
Think of Mule as a big component that may not necessarily implement the
service interface)

I see that you can create your own ComponentProvider, but I don't see a way
to control the way the actual component is invoked. Ideally I would like a
method like:

Object invoke(ComponentProvider r, Method m, Object[] args);

which I can then implement. Does jersey have anything like this?

Dan

-- 
Dan Diephouse
http://mulesource.com | http://netzooid.com/blog