1 22 package org.jboss.test.cluster.web; 23 24 import javax.servlet.http.HttpSessionListener ; 25 import javax.servlet.http.HttpSessionActivationListener ; 26 import javax.servlet.http.HttpSessionEvent ; 27 import javax.servlet.http.HttpSession ; 28 29 33 public class SessionListener 34 implements HttpSessionListener , HttpSessionActivationListener 35 { 36 public void sessionCreated(HttpSessionEvent event) 37 { 38 HttpSession session = event.getSession(); 39 System.out.println("SessionListener.sessionCreated, id="+session.getId()); 40 session.setAttribute("SessionListener", this.toString()); 41 } 42 43 public void sessionDestroyed(HttpSessionEvent event) 44 { 45 HttpSession session = event.getSession(); 46 System.out.println("SessionListener.sessionDestroyed, id="+session.getId()); 47 } 48 49 public void sessionWillPassivate(HttpSessionEvent event) 50 { 51 HttpSession session = event.getSession(); 52 System.out.println("SessionListener.sessionWillPassivate, id="+session.getId()); 53 } 54 55 public void sessionDidActivate(HttpSessionEvent event) 56 { 57 HttpSession session = event.getSession(); 58 System.out.println("SessionListener.sessionDidActivate, id="+session.getId()); 59 } 60 } 61 | Popular Tags |