cmu.survey.jsp
Class WebappShutdownListener

java.lang.Object
  extended by cmu.survey.jsp.WebappShutdownListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public class WebappShutdownListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

Do stuff at a webapp's shutdown. Since this can't be invoked directly at startup time, we have to do a roundabout registration technique -- webapps can register a shutdown listener (which is an ActionListener) that will get called at shutdown time, via this class, since we can't register a shutdown listener directly to the JSP Servlet Engine. It took me so long to find this interface and how to use it in web.xml, found eventually at: http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg147108.html


Field Summary
static java.util.Vector<java.awt.event.ActionListener> shutdownListeners
           
 
Constructor Summary
WebappShutdownListener()
           
 
Method Summary
static void addShutdownListener(java.awt.event.ActionListener actionListener)
           
 void contextDestroyed(javax.servlet.ServletContextEvent arg0)
           
 void contextInitialized(javax.servlet.ServletContextEvent arg0)
           
static boolean removeShutdownListener(java.awt.event.ActionListener actionListener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shutdownListeners

public static java.util.Vector<java.awt.event.ActionListener> shutdownListeners
Constructor Detail

WebappShutdownListener

public WebappShutdownListener()
Method Detail

addShutdownListener

public static void addShutdownListener(java.awt.event.ActionListener actionListener)

removeShutdownListener

public static boolean removeShutdownListener(java.awt.event.ActionListener actionListener)

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent arg0)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent arg0)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener