Top Description Inners Fields Constructors Methods
com.sun.faces.application

public Class WebappLifecycleListener

extends Object
Class Inheritance
Imports
com.sun.faces.application.view.ViewScopeManager, com.sun.faces.config.InitFacesContext, .WebConfiguration, java.io.PrintWriter, java.util.Enumeration, .List, .ArrayList, java.util.logging.Level, .Logger, javax.servlet.ServletContext, .ServletContextAttributeEvent, .ServletContextEvent, .ServletRequest, .ServletRequestAttributeEvent, .ServletRequestEvent, javax.servlet.http.HttpServletRequest, .HttpSession, .HttpSessionBindingEvent, .HttpSessionEvent, com.sun.faces.el.ELUtils, com.sun.faces.flow.FlowCDIContext, com.sun.faces.io.FastStringWriter, com.sun.faces.mgbean.BeanManager, com.sun.faces.renderkit.StateHelper, com.sun.faces.util.FacesLogger, .Util, javax.faces.application.Application, .ViewHandler, javax.faces.context.FacesContext, javax.faces.event.ExceptionQueuedEvent, .ExceptionQueuedEventContext

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.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv class

Field Summary

Modifier and TypeField and Description
private WebappLifecycleListener.ActiveSessions
private ApplicationAssociate
private static final Logger
private ServletContext

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
attributeRemoved(ServletRequestAttributeEvent
the notification event
event
)

Notification that an existing attribute has been removed from the servlet request.

public void
attributeRemoved(HttpSessionBindingEvent
the nofication event
event
)

Notification that an attribute has been removed from a session.

public void
attributeRemoved(ServletContextAttributeEvent
the notification event
event
)

Notification that an existing attribute has been removed from the servlet context.

public void
attributeReplaced(ServletRequestAttributeEvent
the notification event
event
)

Notification that an attribute was replaced on the servlet request.

public void
attributeReplaced(HttpSessionBindingEvent
the notification event
event
)

Notification that an attribute has been replaced in a session.

public void
attributeReplaced(ServletContextAttributeEvent
the notification event
event
)

Notification that an attribute on the servlet context has been replaced.

public void
contextDestroyed(ServletContextEvent
the nofication event
event
)

Notification that the servlet context is about to be shut down.

public void
contextInitialized(ServletContextEvent
the notification event
event
)

Notification that the web application initialization process is starting.

public List<HttpSession>
private ApplicationAssociate
private void
public void
requestDestroyed(ServletRequestEvent
the notification event
event
)

The request is about to go out of scope of the web application.

public void
requestInitialized(ServletRequestEvent
the notification event
event
)

The request is about to come into scope of the web application.

public void
sessionCreated(HttpSessionEvent
the notification event
event
)

Notfication that a session has been created.

public void
sessionDestroyed(HttpSessionEvent
the notification event
event
)

Notification that a session is about to be invalidated.

private void
syncSessionScopedBeans(ServletRequest
the current ServletRequest
request
)

This method ensures that session scoped managed beans will be synchronized properly in a clustered environment.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activeSessionsback to summary
private WebappLifecycleListener.ActiveSessions activeSessions
applicationAssociateback to summary
private ApplicationAssociate applicationAssociate
LOGGERback to summary
private static final Logger LOGGER
servletContextback to summary
private ServletContext servletContext

Constructor Detail

WebappLifecycleListenerback to summary
public WebappLifecycleListener()
WebappLifecycleListenerback to summary
public WebappLifecycleListener(ServletContext servletContext)

Method Detail

attributeRemovedback to summary
public void attributeRemoved(ServletRequestAttributeEvent event)

Notification that an existing attribute has been removed from the servlet request. Called after the attribute is removed.

Parameters
event:ServletRequestAttributeEvent

the notification event

attributeRemovedback to summary
public void attributeRemoved(HttpSessionBindingEvent event)

Notification that an attribute has been removed from a session. Called after the attribute is removed.

Parameters
event:HttpSessionBindingEvent

the nofication event

attributeRemovedback to summary
public void attributeRemoved(ServletContextAttributeEvent event)

Notification that an existing attribute has been removed from the servlet context. Called after the attribute is removed.

Parameters
event:ServletContextAttributeEvent

the notification event

attributeReplacedback to summary
public void attributeReplaced(ServletRequestAttributeEvent event)

Notification that an attribute was replaced on the servlet request. Called after the attribute is replaced.

Parameters
event:ServletRequestAttributeEvent

the notification event

attributeReplacedback to summary
public void attributeReplaced(HttpSessionBindingEvent event)

Notification that an attribute has been replaced in a session. Called after the attribute is replaced.

Parameters
event:HttpSessionBindingEvent

the notification event

attributeReplacedback to summary
public void attributeReplaced(ServletContextAttributeEvent event)

Notification that an attribute on the servlet context has been replaced. Called after the attribute is replaced.

Parameters
event:ServletContextAttributeEvent

the notification event

contextDestroyedback to summary
public void contextDestroyed(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.

Parameters
event:ServletContextEvent

the nofication event

contextInitializedback to summary
public void contextInitialized(ServletContextEvent event)

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.

Parameters
event:ServletContextEvent

the notification event

getActiveSessionsback to summary
public List<HttpSession> getActiveSessions()
getAssociateback to summary
private ApplicationAssociate getAssociate()
handleAttributeEventback to summary
private void handleAttributeEvent(String beanName, Object bean, ELUtils.Scope scope)
requestDestroyedback to summary
public void requestDestroyed(ServletRequestEvent event)

The request is about to go out of scope of the web application.

Parameters
event:ServletRequestEvent

the notification event

requestInitializedback to summary
public void requestInitialized(ServletRequestEvent event)

The request is about to come into scope of the web application.

Parameters
event:ServletRequestEvent

the notification event

sessionCreatedback to summary
public void sessionCreated(HttpSessionEvent event)

Notfication that a session has been created.

Parameters
event:HttpSessionEvent

the notification event

sessionDestroyedback to summary
public void sessionDestroyed(HttpSessionEvent event)

Notification that a session is about to be invalidated.

Parameters
event:HttpSessionEvent

the notification event

syncSessionScopedBeansback to summary
private void syncSessionScopedBeans(ServletRequest request)

This method ensures that session scoped managed beans will be synchronized properly in a clustered environment.

Parameters
request:ServletRequest

the current ServletRequest

com.sun.faces.application back to summary

pack-priv Class WebappLifecycleListener.ActiveSessions

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.faces.application.WebappLifecycleListener.ActiveSessions

Field Summary

Modifier and TypeField and Description
private List<HttpSession>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public synchronized void
public synchronized List<HttpSession>
get()

public synchronized void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

activeSessionsback to summary
private List<HttpSession> activeSessions

Constructor Detail

ActiveSessionsback to summary
public ActiveSessions()

Method Detail

addback to summary
public synchronized void add(HttpSession hs)
getback to summary
public synchronized List<HttpSession> get()
removeback to summary
public synchronized void remove(HttpSession hs)