users@jersey.java.net

Decorating Resource Methods in Jersey

From: Mark Maxey <markmaxey_at_verizon.net>
Date: Mon, 26 Oct 2009 21:31:07 -0500

Is there a way to "wrap" an arbitrary resource method? I have a use
case where I'd like to intercept the method Jersey is about to call,
wrap it with some custom decorators, and then call the decorated
method. These decorators act like a container managing transactions,
non-JSR 311 exceptions, etc.

Alternatively, I could use some type of handler/interceptor that allows
me to inject custom logic before and after an arbitrary resource method
is called.


Thanks in advance,
Mark