Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

shutdown tomcat

Maksimenko Alexander

2003-08-19

Replies:

Hi!
I created the following implementation of HttpSessionListener,HttpSessionActivationListener.

public class TestTomcatNotifications implements HttpSessionListener, HttpSessionActivationListener {
public void sessionCreated(HttpSessionEvent se) {
  System.out.println("TestTomcatNotifications.sessionCreated(se)");
}
public void sessionDestroyed(HttpSessionEvent se) {
  System.out.println("TestTomcatNotifications.sessionDestroyed(se)");
}
public void sessionWillPassivate(HttpSessionEvent se) {
  System.out.println("TestTomcatNotifications.sessionWillPassivate(se)");
}
public void sessionDidActivate(HttpSessionEvent se) {
  System.out.println("TestTomcatNotifications.sessionDidActivate(se)");
}
}

So this class logs that some method was invoked only. But when I am shut down tomcat neither sessionWillPassivate nor sessionDestroyed are been invoked. In API Doc we can read that:
"A container that migrates session between VMs or persists sessions is required to notify all attributes bound to sessions implementing HttpSessionActivationListener".
What's wrong?

P.S. I use org.apache.catalina.session.StandardManager implementation.
©2008 junlu.com - Jax Systems, LLC, U.S.A.