From: Fredrik Tolf Date: Mon, 26 Oct 2009 18:54:13 +0000 (+0100) Subject: Upon session expiration, call destroy() on ContextResponders from PerSession. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=1927b2641ba2f28352286df7e4fd63356d42a894;p=jsvc.git Upon session expiration, call destroy() on ContextResponders from PerSession. --- diff --git a/src/dolda/jsvc/util/PerSession.java b/src/dolda/jsvc/util/PerSession.java index 1cbc0d7..deec822 100644 --- a/src/dolda/jsvc/util/PerSession.java +++ b/src/dolda/jsvc/util/PerSession.java @@ -93,6 +93,14 @@ public class PerSession implements Responder { if(resp == null) { resp = create(sess); sess.put(rcl, resp); + if(resp instanceof ContextResponder) { + final ContextResponder cr = (ContextResponder)resp; + sess.listen(new Session.Listener() { + public void expire(Session sess) { + cr.destroy(); + } + }); + } } } resp.respond(req);