Class WebappLifecycleListener


  • public class WebappLifecycleListener
    extends Object

    Central location for web application lifecycle events.

    The main purpose of this class is detect when we should be invoking methods marked with the @PreDestroy annotation.

    • Constructor Detail

      • WebappLifecycleListener

        public WebappLifecycleListener()
      • WebappLifecycleListener

        public WebappLifecycleListener​(jakarta.servlet.ServletContext servletContext)
    • Method Detail

      • requestInitialized

        public void requestInitialized​(jakarta.servlet.ServletRequestEvent event)
        The request is about to come into scope of the web application.
        Parameters:
        event - the notification event
      • requestDestroyed

        public void requestDestroyed​(jakarta.servlet.ServletRequestEvent event)
        The request is about to go out of scope of the web application.
        Parameters:
        event - the notification event
      • sessionCreated

        public void sessionCreated​(jakarta.servlet.http.HttpSessionEvent event)
        Notification that a session has been created.
        Parameters:
        event - the notification event
      • sessionDestroyed

        public void sessionDestroyed​(jakarta.servlet.http.HttpSessionEvent event)
        Notification that a session is about to be invalidated.
        Parameters:
        event - the notification event
      • contextInitialized

        public void contextInitialized​(jakarta.servlet.ServletContextEvent event)
        Notification that the web application initialization process is starting. All ServletContextListeners are notified of context initialization before any filter or servlet in the web application is initialized.
        Parameters:
        event - the notification event
      • contextDestroyed

        public void contextDestroyed​(jakarta.servlet.ServletContextEvent event)
        Notification that the servlet context is about to be shut down. All servlets and filters have been destroy()ed before any ServletContextListeners are notified of context destruction.
        Parameters:
        event - the nofication event
      • getActiveSessions

        public List<jakarta.servlet.http.HttpSession> getActiveSessions()