java - Jersey: pre- and post-exec hooks? -


i'm using aspectj handle transactions in jersey restful classes. want dump simplicity , consistency reasons (less technologies -> more transparency, better ide support). want rest method implementations return w3c document class, ie. having post-exec hooks transforms results.

does jersey provide pre- , post-exec hook allow me initiate , close transactions , perform transformations on results returned remote end?

assuming you're using version 2.x, jersey has built in support this, using event listeners. can use requesteventlistener, , requestevent give access goodies. matter of fact, transaction handling, way dropwizard handles it.

if event handlers doesn't suit needs, there more of "natural" aop support hk2 (which jersey uses di). check out this article complete example integrating jersey.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -