From 1927b2641ba2f28352286df7e4fd63356d42a894 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Mon, 26 Oct 2009 19:54:13 +0100 Subject: [PATCH] Upon session expiration, call destroy() on ContextResponders from PerSession. --- src/dolda/jsvc/util/PerSession.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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); -- 2.11.0