/** @see ServletContextListener#contextDestroyed(ServletContextEvent) */ public void contextDestroyed(ServletContextEvent arg0) { if (distriServer != null) distriServer.stop(); if (activityServer != null) activityServer.stop(); Logger.log("Tomcat context destroyed!"); }
/** @see ServletContextListener#contextInitialized(ServletContextEvent) */ public void contextInitialized(ServletContextEvent arg0) { Logger.log("Tomcat context started!"); String path = arg0.getServletContext().getRealPath("/"); distriServer = new WebSocketServer(path); distriServerThread = new Thread(distriServer, "websocket-server"); distriServerThread.start(); activityServer = new ActivityMonitoringServer(); activityMonitorThread = new Thread(activityServer, "activity-monitor"); activityMonitorThread.start(); }