private void initializeAtmosphere(MultiBitExchangeApiConfiguration configuration, Environment environment) { FilterBuilder fconfig = environment.addFilter(CrossOriginFilter.class, "/stream"); fconfig.setInitParam(CrossOriginFilter.ALLOWED_ORIGINS_PARAM, "*"); AtmosphereServlet atmosphereServlet = new AtmosphereServlet(); atmosphereServlet.framework().addInitParameter("com.sun.jersey.config.property.packages", ATMOSPHERE_RESOURCE_BASE_PACKAGE); atmosphereServlet.framework().addInitParameter("org.atmosphere.websocket.messageContentType", "application/json"); atmosphereServlet.framework().addInitParameter("com.sun.jersey.config.feature.DisableWADL", "true"); atmosphereServlet.framework().addInitParameter("org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults", "true"); atmosphereServlet.framework().addInitParameter("org.atmosphere.cpr.broadcasterCacheClass", "org.atmosphere.cache.UUIDBroadcasterCache"); atmosphereServlet.framework().addInitParameter("org.atmosphere.cpr.sessionSupport", "true"); atmosphereServlet.framework().addInitParameter("org.atmosphere.cpr.AtmosphereResource.uniqueUUID", "true"); atmosphereServlet.framework().addInitParameter(ApplicationConfig.class.getName() + ".scanClassPath", "false"); environment.addServlet(atmosphereServlet, "/stream/*"); } }