/** * Load the {@link AtmosphereHandler} associated with this AtmosphereServlet. * @param sc the {@link ServletContext} */ @Override public void init(ServletConfig sc) throws ServletException{ super.init(sc); try{ //TODO -> Add support for WEB-INF/lib/*.jar URL url = sc.getServletContext().getResource("/WEB-INF/classes/"); URLClassLoader urlC = new URLClassLoader(new URL[] {url}, Thread.currentThread().getContextClassLoader()); loadAtmosphereDotXml(sc.getServletContext(). getResourceAsStream("/META-INF/atmosphere.xml"), urlC); if (atmosphereHandlers.size() == 0){ logger.warning("Missing META-INF/atmosphere.xml." + " Will try to autodetect AtmosphereHandler"); autoDetectAtmosphereHandlers(sc.getServletContext(), urlC); } } catch (Throwable t){ throw new ServletException(t); } autoDetectContainer(); cometSupport.init(sc); initAtmosphereServletProcessor(sc); }