com.opensymphony.webwork.lifecycle
Class SessionLifecycleListener

java.lang.Object
  extended bycom.opensymphony.webwork.lifecycle.SessionLifecycleListener
All Implemented Interfaces:
EventListener, HttpSessionListener, Serializable

public class SessionLifecycleListener
extends Object
implements HttpSessionListener, Serializable

A filter to handle the lifecycle of an HTTP session-based XWork component manager.

Author:
Joe Walnes, Cameron Braid, Bill Lynch (docs)
See Also:
Serialized Form

Constructor Summary
SessionLifecycleListener()
           
 
Method Summary
protected  com.opensymphony.xwork.interceptor.component.DefaultComponentManager createComponentManager()
          Returns a new DefaultComponentManager instance.
protected  ServletContext getServletContext(HttpSession session)
          Servlet 2.3 specifies that the servlet context can be retrieved from the session.
 void sessionCreated(HttpSessionEvent event)
          Initializes an XWork component manager for the lifetime of the user's session.
 void sessionDestroyed(HttpSessionEvent event)
          Does nothing - when the session is destroyed the component manager reference will go away as well.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionLifecycleListener

public SessionLifecycleListener()
Method Detail

sessionCreated

public void sessionCreated(HttpSessionEvent event)
Initializes an XWork component manager for the lifetime of the user's session.

Specified by:
sessionCreated in interface HttpSessionListener
Parameters:
event - an HttpSessionEvent object.

sessionDestroyed

public void sessionDestroyed(HttpSessionEvent event)
Does nothing - when the session is destroyed the component manager reference will go away as well.

Specified by:
sessionDestroyed in interface HttpSessionListener
Parameters:
event - an HttpSessionEvent object.

getServletContext

protected ServletContext getServletContext(HttpSession session)
Servlet 2.3 specifies that the servlet context can be retrieved from the session. Unfortunately, some versions of WebLogic can only retrieve the servlet context from the filter config. Hence, this method enables subclasses to retrieve the servlet context from other sources.

Parameters:
session - the HTTP session where, in Servlet 2.3, the servlet context can be retrieved
Returns:
the servlet context.

createComponentManager

protected com.opensymphony.xwork.interceptor.component.DefaultComponentManager createComponentManager()
Returns a new DefaultComponentManager instance. This method is useful for developers wishing to subclass this class and provide a different implementation of DefaultComponentManager.

Returns:
a new DefaultComponentManager instance.

WebWork Project Page