Class HttpSessionListenerDelegator

java.lang.Object
org.eclnt.jsfserver.util.HttpSessionListenerDelegator
All Implemented Interfaces:
Serializable, EventListener, javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener

public class HttpSessionListenerDelegator extends Object implements javax.servlet.http.HttpSessionListener, javax.servlet.ServletContextListener, Serializable
Central HttpSessionListener implementation that allows to add IHttpSessionClosedReactor instances at runtime. This is a convenience implementation for getting notified when an http session is closed by the servlet container.

At runtime one instance of HttpSessionListenerDelegator is created per http session. You may add a listener by using addReactor(String, IHttpSessionClosedReactor) that informs you about an http session being closed.
See Also:
  • Constructor Details

    • HttpSessionListenerDelegator

      public HttpSessionListenerDelegator()
  • Method Details

    • contextInitialized

      public void contextInitialized(javax.servlet.ServletContextEvent sce)
      Specified by:
      contextInitialized in interface javax.servlet.ServletContextListener
    • contextDestroyed

      public void contextDestroyed(javax.servlet.ServletContextEvent arg0)
      Specified by:
      contextDestroyed in interface javax.servlet.ServletContextListener
    • addGlobalSessionListener

      public void addGlobalSessionListener(IHttpSessionListener listener)
    • removeGlobalSessionListener

      public void removeGlobalSessionListener(IHttpSessionListener listener)
    • sessionCreated

      public void sessionCreated(javax.servlet.http.HttpSessionEvent event)
      Specified by:
      sessionCreated in interface javax.servlet.http.HttpSessionListener
    • sessionDestroyed

      public void sessionDestroyed(javax.servlet.http.HttpSessionEvent event)
      Specified by:
      sessionDestroyed in interface javax.servlet.http.HttpSessionListener
    • addReactor

      public void addReactor(String id, IHttpSessionClosedReactor listener)
      The reactor is passed, associated with a certain id. There is no certain meaning behind the id, you may use the id for checking from outside if a certain listener already was set using the getReactor(id) method.
    • removeReactor

      public void removeReactor(String id)
    • getReactors

      public Collection<IHttpSessionClosedReactor> getReactors()
    • getReactor

      public IHttpSessionClosedReactor getReactor(String id)
      Get reactor for a certain id.
    • ensureInitialized

      public static void ensureInitialized()