org.jafer.zserver.util
Class ContextListener

java.lang.Object
  extended by org.jafer.zserver.util.ContextListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.ServletContextListener

public final class ContextListener
extends java.lang.Object
implements javax.servlet.ServletContextListener

Allows automatic startup/shutdown of ZServerManager and servers by reference to listener in web.xml. Tested with Tomcat 4 only; relevant for Servlet/JSP Spec 2.3/1.2 or higher.

Version:
1.0
Author:
Antony Corfield; Matthew Dovey; Colin Tatham

Field Summary
private static javax.servlet.ServletContext context
           
private static boolean contextInitialized
           
private static java.util.logging.Logger logger
           
 
Constructor Summary
ContextListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent event)
          Record the fact that this web application has been destroyed.
 void contextInitialized(javax.servlet.ServletContextEvent event)
          Record the fact that this web application has been initialized.
static javax.servlet.ServletContext getContext()
           
static boolean isContextInitialized()
           
private  void setContext(javax.servlet.ServletContext servletContext)
           
private  void setContextInitialized(boolean state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger

context

private static javax.servlet.ServletContext context

contextInitialized

private static boolean contextInitialized
Constructor Detail

ContextListener

public ContextListener()
Method Detail

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent event)
Record the fact that this web application has been destroyed.

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener
Parameters:
event - The servlet context event

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent event)
Record the fact that this web application has been initialized.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
Parameters:
event - The servlet context event

setContext

private void setContext(javax.servlet.ServletContext servletContext)

getContext

public static javax.servlet.ServletContext getContext()

setContextInitialized

private void setContextInitialized(boolean state)

isContextInitialized

public static boolean isContextInitialized()