users@jersey.java.net

accessing response

From: Jon Iantosca <digester_at_gmail.com>
Date: Thu, 5 Nov 2009 10:58:44 -0500

Howdy - I'm hoping someone can point me in the direction of how to go about
accessing my restful responses. More specifically, I'd like access to the
serialized response after my resource method has executed, but before it's
written out to the client. My resource methods typically resemble the sample
code below, producing both xml and json, but I'm hoping to find a solution
that doesn't care about what's being returned. I'm hoping I can perhaps
register something like an "about to send a response" kind of listener. Can
someone point me int he right direction here?

@GET
@Produces({"application/xml", "application/json"})
@Path( "account/{number}" )
public Portfolio getSummary( @PathParam("number") String number ) {
    AccountDelegate delegate = new AccountDelegate( number );
    return delegate.getSummary();
}