Class AppContextListener

  • All Implemented Interfaces:
    jakarta.servlet.ServletContextListener, EventListener

    @WebListener
    public class AppContextListener
    extends Object
    implements jakarta.servlet.ServletContextListener
    This listener is used so that we can safely stop the MaintenanceThread when the web app is undeployed.

    We can put an entry in web.xml for this listener, but we don't actually do, because the @WebListener annotation does the trick.

    For some examples of using context listeners, see e.g. https://www.digitalocean.com/community/tutorials/servletcontextlistener-servlet-listener-example

    • Constructor Detail

      • AppContextListener

        public AppContextListener()
    • Method Detail

      • contextInitialized

        public void contextInitialized​(jakarta.servlet.ServletContextEvent servletContextEvent)
        Specified by:
        contextInitialized in interface jakarta.servlet.ServletContextListener
      • contextDestroyed

        public void contextDestroyed​(jakarta.servlet.ServletContextEvent servletContextEvent)
        Specified by:
        contextDestroyed in interface jakarta.servlet.ServletContextListener