Upon session expiration, call destroy() on ContextResponders from PerSession.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 26 Oct 2009 18:54:13 +0000 (19:54 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 26 Oct 2009 18:54:13 +0000 (19:54 +0100)
src/dolda/jsvc/util/PerSession.java

index 1cbc0d7..deec822 100644 (file)
@@ -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);