You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by de...@apache.org on 2010/09/14 16:20:27 UTC

svn commit: r996910 - /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java

Author: dejanb
Date: Tue Sep 14 14:20:27 2010
New Revision: 996910

URL: http://svn.apache.org/viewvc?rev=996910&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQ-1933 - unsubscribing REST consumers

Added:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java

Added: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java?rev=996910&view=auto
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java (added)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/SessionListener.java Tue Sep 14 14:20:27 2010
@@ -0,0 +1,22 @@
+package org.apache.activemq.web;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+
+public class SessionListener implements HttpSessionListener {
+    private static final Log LOG = LogFactory.getLog(SessionListener.class);
+
+    public void sessionCreated(HttpSessionEvent se) {
+    }
+
+    public void sessionDestroyed(HttpSessionEvent se) {
+        WebClient client = WebClient.getWebClient(se.getSession());
+        if (client != null) {
+            client.close();
+        }
+    }
+}