eXo Kernel :: Container 2.5.0-GA

org.exoplatform.container.context
Class ContextManagerListener

java.lang.Object
  extended by org.exoplatform.container.web.AbstractHttpSessionListener
      extended by org.exoplatform.container.context.ContextManagerListener
All Implemented Interfaces:
EventListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletRequestListener

public class ContextManagerListener
extends AbstractHttpSessionListener
implements javax.servlet.ServletRequestListener

This listener is used to manage the components of scope SessionScoped and RequestScoped

Version:
$Id$
Author:
Nicolas Filotto

Constructor Summary
ContextManagerListener()
           
 
Method Summary
protected  ExoContainer getContainer(javax.servlet.ServletRequestEvent event)
           
protected  void onRequestDestroyed(ExoContainer container, javax.servlet.ServletRequestEvent event)
          Called when a request is destroyed
protected  void onRequestInitialized(ExoContainer container, javax.servlet.ServletRequestEvent event)
          Called when a request is created
protected  void onSessionCreated(ExoContainer container, javax.servlet.http.HttpSessionEvent event)
          Allow sub-classes to execute an action when a session is created
protected  void onSessionDestroyed(ExoContainer container, javax.servlet.http.HttpSessionEvent event)
          Allow sub-classes to execute an action when a session is destroyed
static void registerIfNeeded(ExoContainer container, javax.servlet.ServletContext context)
          Registers dynamically the listener if a ContextManager has been defined and a context for SessionScoped and/or RequestScoped has been configured.
 void requestDestroyed(javax.servlet.ServletRequestEvent event)
          
 void requestInitialized(javax.servlet.ServletRequestEvent event)
          
protected  boolean requirePortalEnvironment()
          Indicates if it requires that a full portal environment must be set
 
Methods inherited from class org.exoplatform.container.web.AbstractHttpSessionListener
getContainer, sessionCreated, sessionDestroyed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextManagerListener

public ContextManagerListener()
Method Detail

requestDestroyed

public void requestDestroyed(javax.servlet.ServletRequestEvent event)

Specified by:
requestDestroyed in interface javax.servlet.ServletRequestListener

requestInitialized

public void requestInitialized(javax.servlet.ServletRequestEvent event)

Specified by:
requestInitialized in interface javax.servlet.ServletRequestListener

requirePortalEnvironment

protected boolean requirePortalEnvironment()
Indicates if it requires that a full portal environment must be set

Specified by:
requirePortalEnvironment in class AbstractHttpSessionListener
Returns:
true if it requires the portal environment false otherwise.

onRequestInitialized

protected void onRequestInitialized(ExoContainer container,
                                    javax.servlet.ServletRequestEvent event)
Called when a request is created


onRequestDestroyed

protected void onRequestDestroyed(ExoContainer container,
                                  javax.servlet.ServletRequestEvent event)
Called when a request is destroyed


onSessionCreated

protected void onSessionCreated(ExoContainer container,
                                javax.servlet.http.HttpSessionEvent event)
Allow sub-classes to execute an action when a session is created

Specified by:
onSessionCreated in class AbstractHttpSessionListener
Parameters:
container - the eXo container
event - the HttpSessionEvent

onSessionDestroyed

protected void onSessionDestroyed(ExoContainer container,
                                  javax.servlet.http.HttpSessionEvent event)
Allow sub-classes to execute an action when a session is destroyed

Specified by:
onSessionDestroyed in class AbstractHttpSessionListener
Parameters:
container - the eXo container
event - the HttpSessionEvent

getContainer

protected final ExoContainer getContainer(javax.servlet.ServletRequestEvent event)
Returns:
Gives the ExoContainer that fits best with the current context

registerIfNeeded

public static void registerIfNeeded(ExoContainer container,
                                    javax.servlet.ServletContext context)
Registers dynamically the listener if a ContextManager has been defined and a context for SessionScoped and/or RequestScoped has been configured.

Parameters:
container - the container from which we will get the ContextManager
context - the context to which we want to add the listener

eXo Kernel :: Container 2.5.0-GA

Copyright © 2014 eXo Platform SAS. All Rights Reserved.