Class ContextManagerListener
- java.lang.Object
-
- org.exoplatform.container.web.AbstractHttpSessionListener
-
- 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 scopeSessionScopedandRequestScoped- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Constructor Summary
Constructors Constructor Description ContextManagerListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ExoContainergetContainer(javax.servlet.ServletRequestEvent event)protected voidonRequestDestroyed(ExoContainer container, javax.servlet.ServletRequestEvent event)Called when a request is destroyedprotected voidonRequestInitialized(ExoContainer container, javax.servlet.ServletRequestEvent event)Called when a request is createdprotected voidonSessionCreated(ExoContainer container, javax.servlet.http.HttpSessionEvent event)Allow sub-classes to execute an action when a session is createdprotected voidonSessionDestroyed(ExoContainer container, javax.servlet.http.HttpSessionEvent event)Allow sub-classes to execute an action when a session is destroyedstatic voidregisterIfNeeded(ExoContainer container, javax.servlet.ServletContext context)Registers dynamically the listener if aContextManagerhas been defined and a context for SessionScoped and/or RequestScoped has been configured.voidrequestDestroyed(javax.servlet.ServletRequestEvent event)voidrequestInitialized(javax.servlet.ServletRequestEvent event)protected booleanrequirePortalEnvironment()Indicates if it requires that a full portal environment must be set-
Methods inherited from class org.exoplatform.container.web.AbstractHttpSessionListener
getContainer, sessionCreated, sessionDestroyed
-
-
-
-
Method Detail
-
requestDestroyed
public void requestDestroyed(javax.servlet.ServletRequestEvent event)
- Specified by:
requestDestroyedin interfacejavax.servlet.ServletRequestListener
-
requestInitialized
public void requestInitialized(javax.servlet.ServletRequestEvent event)
- Specified by:
requestInitializedin interfacejavax.servlet.ServletRequestListener
-
requirePortalEnvironment
protected boolean requirePortalEnvironment()
Indicates if it requires that a full portal environment must be set- Specified by:
requirePortalEnvironmentin classAbstractHttpSessionListener- Returns:
trueif it requires the portal environmentfalseotherwise.
-
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:
onSessionCreatedin classAbstractHttpSessionListener- Parameters:
container- the eXo containerevent- theHttpSessionEvent
-
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:
onSessionDestroyedin classAbstractHttpSessionListener- Parameters:
container- the eXo containerevent- theHttpSessionEvent
-
getContainer
protected final ExoContainer getContainer(javax.servlet.ServletRequestEvent event)
- Returns:
- Gives the
ExoContainerthat fits best with the current context
-
registerIfNeeded
public static void registerIfNeeded(ExoContainer container, javax.servlet.ServletContext context)
Registers dynamically the listener if aContextManagerhas been defined and a context for SessionScoped and/or RequestScoped has been configured.- Parameters:
container- the container from which we will get theContextManagercontext- the context to which we want to add the listener
-
-