org.apache.myfaces.webapp
Class ManagedBeanDestroyerListener

java.lang.Object
  extended by org.apache.myfaces.webapp.ManagedBeanDestroyerListener
All Implemented Interfaces:
EventListener, javax.servlet.http.HttpSessionAttributeListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextAttributeListener, javax.servlet.ServletContextListener, javax.servlet.ServletRequestAttributeListener, javax.servlet.ServletRequestListener

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

Listens to - removing, replacing of attributes in context, session and request - destroying of context, session and request for the ManagedBeanDestroyer to assure right destruction of managed beans in those scopes. This listener is not registered in a tld or web.xml, but will be called by StartupServletContextListener.

Since:
2.0
Version:
$Revision: 1187700 $ $Date: 2011-10-22 07:19:37 -0500 (Sat, 22 Oct 2011) $
Author:
Jakob Korherr (latest modification by $Author: bommel $)

Field Summary
static String APPLICATION_MAP_KEY
          The instance of the ManagedBeanDestroyerListener created by StartupServletContextListener is stored under this key in the ApplicationMap.
 
Constructor Summary
ManagedBeanDestroyerListener()
           
 
Method Summary
 void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
           
 void attributeAdded(javax.servlet.ServletContextAttributeEvent event)
           
 void attributeAdded(javax.servlet.ServletRequestAttributeEvent event)
           
 void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
           
 void attributeRemoved(javax.servlet.ServletContextAttributeEvent event)
           
 void attributeRemoved(javax.servlet.ServletRequestAttributeEvent event)
           
 void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
           
 void attributeReplaced(javax.servlet.ServletContextAttributeEvent event)
           
 void attributeReplaced(javax.servlet.ServletRequestAttributeEvent event)
           
 void contextDestroyed(javax.servlet.ServletContextEvent event)
           
 void contextInitialized(javax.servlet.ServletContextEvent event)
           
 void requestDestroyed(javax.servlet.ServletRequestEvent event)
           
 void requestInitialized(javax.servlet.ServletRequestEvent event)
           
 void sessionCreated(javax.servlet.http.HttpSessionEvent event)
           
 void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
           
 void setManagedBeanDestroyer(ManagedBeanDestroyer destroyer)
          Sets the ManagedBeanDestroyer instance to use.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPLICATION_MAP_KEY

public static final String APPLICATION_MAP_KEY
The instance of the ManagedBeanDestroyerListener created by StartupServletContextListener is stored under this key in the ApplicationMap.

See Also:
Constant Field Values
Constructor Detail

ManagedBeanDestroyerListener

public ManagedBeanDestroyerListener()
Method Detail

setManagedBeanDestroyer

public void setManagedBeanDestroyer(ManagedBeanDestroyer destroyer)
Sets the ManagedBeanDestroyer instance to use.

Parameters:
destroyer -

attributeAdded

public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeAdded in interface javax.servlet.http.HttpSessionAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeRemoved in interface javax.servlet.http.HttpSessionAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent event)
Specified by:
attributeReplaced in interface javax.servlet.http.HttpSessionAttributeListener

sessionCreated

public void sessionCreated(javax.servlet.http.HttpSessionEvent event)
Specified by:
sessionCreated in interface javax.servlet.http.HttpSessionListener

sessionDestroyed

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

attributeAdded

public void attributeAdded(javax.servlet.ServletContextAttributeEvent event)
Specified by:
attributeAdded in interface javax.servlet.ServletContextAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.ServletContextAttributeEvent event)
Specified by:
attributeRemoved in interface javax.servlet.ServletContextAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.ServletContextAttributeEvent event)
Specified by:
attributeReplaced in interface javax.servlet.ServletContextAttributeListener

contextInitialized

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

contextDestroyed

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

attributeAdded

public void attributeAdded(javax.servlet.ServletRequestAttributeEvent event)
Specified by:
attributeAdded in interface javax.servlet.ServletRequestAttributeListener

attributeRemoved

public void attributeRemoved(javax.servlet.ServletRequestAttributeEvent event)
Specified by:
attributeRemoved in interface javax.servlet.ServletRequestAttributeListener

attributeReplaced

public void attributeReplaced(javax.servlet.ServletRequestAttributeEvent event)
Specified by:
attributeReplaced in interface javax.servlet.ServletRequestAttributeListener

requestInitialized

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

requestDestroyed

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


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.