listeners
Class ContextListener

java.lang.Object
  extended by listeners.ContextListener
All Implemented Interfaces:
EventListener, ServletContextAttributeListener, ServletContextListener

public final class ContextListener
extends Object
implements ServletContextAttributeListener, ServletContextListener

Example listener for context-related application events, which were introduced in the 2.3 version of the Servlet API. This listener merely documents the occurrence of such events in the application log associated with our servlet context.

Author:
Craig R. McClanahan

Constructor Summary
ContextListener()
           
 
Method Summary
 void attributeAdded(ServletContextAttributeEvent event)
          Record the fact that a servlet context attribute was added.
 void attributeRemoved(ServletContextAttributeEvent event)
          Record the fact that a servlet context attribute was removed.
 void attributeReplaced(ServletContextAttributeEvent event)
          Record the fact that a servlet context attribute was replaced.
 void contextDestroyed(ServletContextEvent event)
          Record the fact that this web application has been destroyed.
 void contextInitialized(ServletContextEvent event)
          Record the fact that this web application has been initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextListener

public ContextListener()
Method Detail

attributeAdded

public void attributeAdded(ServletContextAttributeEvent event)
Record the fact that a servlet context attribute was added.

Specified by:
attributeAdded in interface ServletContextAttributeListener
Parameters:
event - The servlet context attribute event

attributeRemoved

public void attributeRemoved(ServletContextAttributeEvent event)
Record the fact that a servlet context attribute was removed.

Specified by:
attributeRemoved in interface ServletContextAttributeListener
Parameters:
event - The servlet context attribute event

attributeReplaced

public void attributeReplaced(ServletContextAttributeEvent event)
Record the fact that a servlet context attribute was replaced.

Specified by:
attributeReplaced in interface ServletContextAttributeListener
Parameters:
event - The servlet context attribute event

contextDestroyed

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

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

contextInitialized

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

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


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.