If I understand the problem correctly, it sounds like a simple servlet filter 
would do the job nicely.

Map the filter to the same URL pattern the Wink servlet is mapped to, put your 
pre-processing code in the doFilter method before the doChain call, and put 
that important post-processing code in the doFilter method *after* the doChain 
call. 

Alternatively, you can look into the jax-rs RequestHandler and ResponseHandler 
features. I'd go with the standard servlet filter if it were me, but the 
handlers wee an option.

Cameron 
-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

Anton Piatek1 <[email protected]> wrote:

I need to setup a special object for every connection which wink handles. This 
object needsto have its disconnect() method called on it before the request has 
been completely finished with (otherwise the remote resource fills up with a 
load of stale/cached handles). 

The simplest way to do this is if wink offered a pre/post exit-type facility, 
so I could setup a variable before any of my handler classes are invoked, and 
call the disconnect() after they are done. Is there any support in wink for 
this? 

If not, are there any examples of overriding the dispatcher so that I can add 
something just before and just after each handler method is invoked (or class 
created)? I don't want to have to completely implement the wink dispatcher, 
just add a line of code before and after a handler method is invoked. 

Regards, 

Anton


_____________________________________________


Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU 






Reply via email to