wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron Dalton <>
Subject RE: exits or overriding dispatcher
Date Mon, 28 May 2012 14:20:12 GMT
errr...that "doChain" call should be "chain.doFilter" call.

I'm clearly on auto-pilot and talking crazy!


From: Cameron Dalton []
Sent: Monday, May 28, 2012 10:13 AM
Subject: Re: exits or overriding dispatcher

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.

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

Anton Piatek1 <> 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.




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

View raw message