com.sun.faces.application
Class WebappLifecycleListener

java.lang.Object
  extended by com.sun.faces.application.WebappLifecycleListener
All Implemented Interfaces:
java.util.EventListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextAttributeListener, javax.servlet.ServletContextListener, javax.servlet.ServletRequestAttributeListener, javax.servlet.ServletRequestListener

public class WebappLifecycleListener
extends java.lang.Object
implements javax.servlet.ServletRequestListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletRequestAttributeListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.ServletContextAttributeListener, javax.servlet.ServletContextListener

Central location for web application lifecycle events.

The main purpose of this class is detect when we should be invoking methods marked with the @PreDestroy annotation.


Constructor Summary
WebappLifecycleListener()
           
 
Method Summary
 void attributeAdded(javax.servlet.http.HttpSessionBindingEvent se)
          Notification that an attribute has been added to a session.
 void attributeAdded(javax.servlet.ServletContextAttributeEvent scab)
          Notification that a new attribute was added to the servlet context.
 void attributeAdded(javax.servlet.ServletRequestAttributeEvent srae)
          Notification that a new attribute was added to the * servlet request.
 void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
          Notification that an attribute has been removed from a session.
 void attributeRemoved(javax.servlet.ServletContextAttributeEvent event)
          Notification that an existing attribute has been removed from the servlet context.
 void attributeRemoved(javax.servlet.ServletRequestAttributeEvent event)
          Notification that an existing attribute has been removed from the * servlet request.
 void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
          Notification that an attribute has been replaced in a session.
 void attributeReplaced(javax.servlet.ServletContextAttributeEvent event)
          Notification that an attribute on the servlet context has been replaced.
 void attributeReplaced(javax.servlet.ServletRequestAttributeEvent event)
          Notification that an attribute was replaced on the * servlet request.
 void contextDestroyed(javax.servlet.ServletContextEvent event)
          Notification that the servlet context is about to be shut down.
 void contextInitialized(javax.servlet.ServletContextEvent sce)
          Notification that the web application initialization process is starting.
 void requestDestroyed(javax.servlet.ServletRequestEvent event)
          The request is about to go out of scope of the web application.
 void requestInitialized(javax.servlet.ServletRequestEvent sre)
          The request is about to come into scope of the web application.
 void sessionCreated(javax.servlet.http.HttpSessionEvent se)
          Notification that a session was created.
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
          Notification that a session is about to be invalidated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebappLifecycleListener

public WebappLifecycleListener()
Method Detail

requestDestroyed

public void requestDestroyed(javax.servlet.ServletRequestEvent event)
The request is about to go out of scope of the web application.

Specified by:
requestDestroyed in interface javax.servlet.ServletRequestListener

requestInitialized

public void requestInitialized(javax.servlet.ServletRequestEvent sre)
The request is about to come into scope of the web application.

Specified by:
requestInitialized in interface javax.servlet.ServletRequestListener

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent se)
Notification that a session was created.

Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener
Parameters:
se - the notification event

sessionDestroyed

public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
Notification that a session is about to be invalidated.

Specified by:
sessionDestroyed in interface javax.servlet.http.HttpSessionListener
Parameters:
event - the notification event

attributeAdded

public void attributeAdded(javax.servlet.ServletRequestAttributeEvent srae)
Notification that a new attribute was added to the * servlet request. Called after the attribute is added.

Specified by:
attributeAdded in interface javax.servlet.ServletRequestAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.ServletRequestAttributeEvent event)
Notification that an existing attribute has been removed from the * servlet request. Called after the attribute is removed.

Specified by:
attributeRemoved in interface javax.servlet.ServletRequestAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.ServletRequestAttributeEvent event)
Notification that an attribute was replaced on the * servlet request. Called after the attribute is replaced.

Specified by:
attributeReplaced in interface javax.servlet.ServletRequestAttributeListener

attributeAdded

public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent se)
Notification that an attribute has been added to a session. Called after the attribute is added.

Specified by:
attributeAdded in interface javax.servlet.http.HttpSessionAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
Notification that an attribute has been removed from a session. Called after the attribute is removed.

Specified by:
attributeRemoved in interface javax.servlet.http.HttpSessionAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
Notification that an attribute has been replaced in a session. Called after the attribute is replaced.

Specified by:
attributeReplaced in interface javax.servlet.http.HttpSessionAttributeListener

attributeAdded

public void attributeAdded(javax.servlet.ServletContextAttributeEvent scab)
Notification that a new attribute was added to the servlet context. Called after the attribute is added.

Specified by:
attributeAdded in interface javax.servlet.ServletContextAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.ServletContextAttributeEvent event)
Notification that an existing attribute has been removed from the servlet context. Called after the attribute is removed.

Specified by:
attributeRemoved in interface javax.servlet.ServletContextAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.ServletContextAttributeEvent event)
Notification that an attribute on the servlet context has been replaced. Called after the attribute is replaced.

Specified by:
attributeReplaced in interface javax.servlet.ServletContextAttributeListener

contextInitialized

public void contextInitialized(javax.servlet.ServletContextEvent sce)
Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized.

Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent event)
Notification that the servlet context is about to be shut down. All servlets and filters have been destroy()ed before any ServletContextListeners are notified of context destruction.

Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener


Copyright ? 2002-2006 Sun Microsystems, Inc. All Rights Reserved.