Class GenericHttpListener

java.lang.Object
org.exoplatform.container.web.AbstractHttpSessionListener
org.exoplatform.web.GenericHttpListener
All Implemented Interfaces:
jakarta.servlet.http.HttpSessionListener, jakarta.servlet.ServletContextListener, EventListener

public class GenericHttpListener extends org.exoplatform.container.web.AbstractHttpSessionListener implements jakarta.servlet.ServletContextListener
This class is used to broadcast any "HttpEvent" to allow the rest of the platform to be notified without changing the web.xml file. Created by The eXo Platform SAS Author : Nicolas Filotto nicolas.filotto@exoplatform.com 25 sept. 2009
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name of the "context destroyed" event
    static final String
    The name of the "context initialized" event
    static final String
    The name of the "session created" event
    static final String
    The name of the "session destroyed" event
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    contextDestroyed(jakarta.servlet.ServletContextEvent event)
    This method is called when the ServletContext of the Portal is destroyed.
    void
    contextInitialized(jakarta.servlet.ServletContextEvent event)
    This method is called when the ServletContext of the Portal is initialized.
    protected void
    onSessionCreated(org.exoplatform.container.ExoContainer container, jakarta.servlet.http.HttpSessionEvent event)
    This method is called when a HTTP session of a Portal instance is created.
    protected void
    onSessionDestroyed(org.exoplatform.container.ExoContainer container, jakarta.servlet.http.HttpSessionEvent event)
    This method is called when a HTTP session of a Portal instance is destroyed.
    protected boolean
     

    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
  • Field Details

    • SESSION_CREATED

      public static final String SESSION_CREATED
      The name of the "session created" event
      See Also:
    • SESSION_DESTROYED

      public static final String SESSION_DESTROYED
      The name of the "session destroyed" event
      See Also:
    • CONTEXT_INITIALIZED

      public static final String CONTEXT_INITIALIZED
      The name of the "context initialized" event
      See Also:
    • CONTEXT_DESTROYED

      public static final String CONTEXT_DESTROYED
      The name of the "context destroyed" event
      See Also:
  • Constructor Details

    • GenericHttpListener

      public GenericHttpListener()
  • Method Details

    • onSessionCreated

      protected void onSessionCreated(org.exoplatform.container.ExoContainer container, jakarta.servlet.http.HttpSessionEvent event)
      This method is called when a HTTP session of a Portal instance is created. In this method, we: 1) first get the portal instance name for which the session is created. 2) Put the portal instance in the Portal ThreadLocal 3) Broadcast the SESSION_CREATED event 4) Flush the ThreadLocal for the PortalContainer
      Specified by:
      onSessionCreated in class org.exoplatform.container.web.AbstractHttpSessionListener
    • onSessionDestroyed

      protected void onSessionDestroyed(org.exoplatform.container.ExoContainer container, jakarta.servlet.http.HttpSessionEvent event)
      This method is called when a HTTP session of a Portal instance is destroyed. In this method, we: 1) first get the portal instance name for which the session is created. 2) Put the portal instance in the Portal ThreadLocal 3) Broadcast the SESSION_DESTROYED event 4) Flush the ThreadLocal for the PortalContainer
      Specified by:
      onSessionDestroyed in class org.exoplatform.container.web.AbstractHttpSessionListener
    • contextDestroyed

      public void contextDestroyed(jakarta.servlet.ServletContextEvent event)
      This method is called when the ServletContext of the Portal is destroyed. In this method, we: 1) first get the portal instance name for which the session is created. 2) Put the portal instance in the Portal ThreadLocal 3) Broadcast the CONTEXT_DESTROYED event 4) Flush the ThreadLocal for the PortalContainer
      Specified by:
      contextDestroyed in interface jakarta.servlet.ServletContextListener
    • contextInitialized

      public void contextInitialized(jakarta.servlet.ServletContextEvent event)
      This method is called when the ServletContext of the Portal is initialized. In this method, we: 1) first get the portal instance name for which the session is created. 2) Put the portal instance in the Portal ThreadLocal 3) Broadcast the CONTEXT_INITIALIZED event 4) Flush the ThreadLocal for the PortalContainer
      Specified by:
      contextInitialized in interface jakarta.servlet.ServletContextListener
    • requirePortalEnvironment

      protected boolean requirePortalEnvironment()
      Specified by:
      requirePortalEnvironment in class org.exoplatform.container.web.AbstractHttpSessionListener
      See Also:
      • AbstractHttpSessionListener.requirePortalEnvironment()