to.etc.iocular.web
Class WebApplicationListener

java.lang.Object
  extended by to.etc.iocular.web.WebApplicationListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener, javax.servlet.ServletRequestListener

public class WebApplicationListener
extends java.lang.Object
implements javax.servlet.ServletContextListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletRequestListener

This listener must be registered as a 'listener' entry in web.xml for any webapp that requires the use of the iocular container. An example config would be:


                        to.etc.iocular.web.WebApplicationListener
                
 ]]>
 

This receives info when the web application starts and when it ends; this creates the web- and session-scoped containers.

Author:
jal Created on Mar 25, 2007

Constructor Summary
WebApplicationListener()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent cxe)
           
 void contextInitialized(javax.servlet.ServletContextEvent cxe)
          A webapp is starting.
static WebConfiguration createConfiguration(javax.servlet.ServletContext ctx)
          Entry called to configure the web app, if still needed.
 void requestDestroyed(javax.servlet.ServletRequestEvent e)
           
 void requestInitialized(javax.servlet.ServletRequestEvent e)
           
 void sessionCreated(javax.servlet.http.HttpSessionEvent se)
          Creates the session container when a new session is registered.
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebApplicationListener

public WebApplicationListener()
Method Detail

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent cxe)
A webapp is starting. This retrieves the configuration for all containers, and creates the Application container.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener
See Also:
ServletContextListener.contextInitialized(javax.servlet.ServletContextEvent)

contextDestroyed

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

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
Creates the session container when a new session is registered.

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener
See Also:
HttpSessionListener.sessionCreated(javax.servlet.http.HttpSessionEvent)

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent se)
Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener

requestInitialized

public void requestInitialized(javax.servlet.ServletRequestEvent e)
Specified by:
requestInitialized in interface javax.servlet.ServletRequestListener

requestDestroyed

public void requestDestroyed(javax.servlet.ServletRequestEvent e)
Specified by:
requestDestroyed in interface javax.servlet.ServletRequestListener

createConfiguration

public static WebConfiguration createConfiguration(javax.servlet.ServletContext ctx)
                                            throws java.lang.Exception
Entry called to configure the web app, if still needed.

Parameters:
ctx -
Returns:
Throws:
java.lang.Exception