@Override public AtmosphereFramework addInitParameter(String name, String value) { if (vaadinServletConfig.getInitParameter(name) == null) { super.addInitParameter(name, value); } return this; } };
atmosphere.addInitParameter(ApplicationConfig.BROADCASTER_CACHE, UUIDBroadcasterCache.class.getName()); atmosphere.addInitParameter(ApplicationConfig.ANNOTATION_PROCESSOR, VoidAnnotationProcessor.class.getName()); atmosphere.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); atmosphere.addInitParameter(ApplicationConfig.MESSAGE_DELIMITER, String.valueOf(PushConstants.MESSAGE_DELIMITER)); atmosphere.addInitParameter( ApplicationConfig.DROP_ACCESS_CONTROL_ALLOW_ORIGIN_HEADER, "false"); atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_BUFFER_SIZE, bufferSize); atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_MAXTEXTSIZE, bufferSize); atmosphere.addInitParameter(ApplicationConfig.WEBSOCKET_MAXBINARYSIZE, bufferSize); atmosphere.addInitParameter( ApplicationConfig.PROPERTY_ALLOW_SESSION_TIMEOUT_REMOVAL, "false"); atmosphere.addInitParameter(ApplicationConfig.RECOVER_DEAD_BROADCASTER, "false"); atmosphere.addInitParameter("org.atmosphere.cpr.showSupportMessage", "false");
public AtmosphereCoordinator path(String mappingPath) { framework.addInitParameter(ApplicationConfig.ATMOSPHERE_HANDLER_MAPPING, mappingPath); return this; }
public AtmosphereCoordinator path(String mappingPath) { framework.addInitParameter(ApplicationConfig.ATMOSPHERE_HANDLER_MAPPING, mappingPath); return this; }
private static void addInitParameter(AtmosphereFramework fw, Map<String, String> initParams, String name, String value) { fw.addInitParameter(name, value); initParams.put(name, value); } @Override
@Override public AtmosphereFramework addInitParameter(String name, String value) { if (vaadinServletConfig.getInitParameter(name) == null) { super.addInitParameter(name, value); } return this; } };
@Override public AtmosphereFramework addInitParameter(String name, String value) { if (vaadinServletConfig.getInitParameter(name) == null) { super.addInitParameter(name, value); } return this; } };
private static void addInitParameter(AtmosphereFramework fw, Map<String, String> initParams, String name, String value) { fw.addInitParameter(name, value); initParams.put(name, value); } @Override
public JSR356SwaggerSocketServlet(boolean isFilter, boolean autoDetectHandlers) { super(isFilter, autoDetectHandlers); framework().addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "false"); framework().addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT_SERVLET3, "true"); framework().addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); }
private AtmosphereFramework create(Bus bus) { final AtmosphereFramework instance = new AtmosphereFramework(false, true); instance.setUseNativeImplementation(false); instance.addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true"); instance.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); instance.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); instance.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); // workaround for atmosphere's jsr356 initialization requiring servletConfig instance.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true"); AtmosphereUtils.addInterceptors(instance, bus); instance.addAtmosphereHandler("/", new DestinationHandler()); return instance; }
public SwaggerSocketServlet(boolean isFilter, boolean autoDetectHandlers) { super(isFilter, autoDetectHandlers); framework().addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true"); framework().addInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true"); framework().addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); }
private AtmosphereFramework create(Bus bus) { final AtmosphereFramework instance = new AtmosphereFramework(false, true); instance.setUseNativeImplementation(false); instance.addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true"); instance.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); instance.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); instance.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); // workaround for atmosphere's jsr356 initialization requiring servletConfig instance.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true"); AtmosphereUtils.addInterceptors(instance, bus); instance.addAtmosphereHandler("/", new DestinationHandler()); return instance; }
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/*"); } }
public AtmosphereWebSocketUndertowDestination(Bus bus, DestinationRegistry registry, EndpointInfo ei, UndertowHTTPServerEngineFactory serverEngineFactory) throws IOException { super(bus, registry, ei, serverEngineFactory); framework = new AtmosphereFramework(false, true); framework.setUseNativeImplementation(false); framework.addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true"); framework.addInitParameter(ApplicationConfig.PROPERTY_SESSION_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL_EXECUTION, "true"); // workaround for atmosphere's jsr356 initialization requiring servletConfig framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "true"); AtmosphereUtils.addInterceptors(framework, bus); framework.addAtmosphereHandler("/", new DestinationHandler()); framework.init(); executor = bus.getExtension(WorkQueueManager.class).getAutomaticWorkQueue(); }
@Override public void onServletConfigAvailable(ServletConfig config) throws ServletException { // Very likely there is JSR-356 implementation available, let us reconfigure the Atmosphere framework // to use it since ServletConfig instance is already available. final Object container = config.getServletContext() .getAttribute("javax.websocket.server.ServerContainer"); if (container != null) { if (framework.initialized()) { framework.destroy(); } framework = create(getBus()); framework.addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "false"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "false"); framework.init(config); } }
@Override public void onServletConfigAvailable(ServletConfig config) throws ServletException { // Very likely there is JSR-356 implementation available, let us reconfigure the Atmosphere framework // to use it since ServletConfig instance is already available. final Object container = config.getServletContext() .getAttribute("javax.websocket.server.ServerContainer"); if (container != null) { if (framework.initialized()) { framework.destroy(); } framework = create(getBus()); framework.addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "false"); framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPRESS_JSR356, "false"); framework.init(config); } }
public SwaggerSocketServlet(boolean isFilter, boolean autoDetectHandlers) { super(isFilter, autoDetectHandlers); framework().setWebSocketProtocolClassName(SwaggerSocketProtocol.class.getName()); framework().interceptor(new SwaggerSocketProtocolHttpSupport()); framework().addInitParameter(ApplicationConfig.PROPERTY_NATIVE_COMETSUPPORT, "true"); framework().addInitParameter("com.sun.jersey.api.json.POJOMappingFeature", "true"); framework().addInitParameter(DISABLE_ATMOSPHEREINTERCEPTOR, "true"); framework().broadcasterFilters().add(LongPollingBroadcastFilter.class.getName()); }
public void configureFramework(ServletConfig config) throws ServletException { initializer.configureFramework(config, false, false, AtmosphereFramework.class); this.framework = initializer.framework(); this.framework.setUseNativeImplementation(false); this.framework.addInitParameter(ApplicationConfig.ANALYTICS, "false"); this.framework.addInitParameter(ApplicationConfig.WEBSOCKET_SUPPORT, "true"); this.framework.addInitParameter(ApplicationConfig.WEBSOCKET_PROTOCOL, getEndpoint().isUseStreaming() ? WebsocketStreamHandler.class.getName() : WebsocketHandler.class.getName()); this.framework.init(config); WebSocketProtocol wsp = this.framework.getWebSocketProtocol(); if (wsp instanceof WebsocketHandler) { ((WebsocketHandler)wsp).setConsumer(this); } else { throw new IllegalArgumentException("Unexpected WebSocketHandler: " + wsp); } }
public AtmosphereCoordinator ready() { framework().addInitParameter(ApplicationConfig.ALLOW_QUERYSTRING_AS_REQUEST, "false"); ServletProxyFactory.getDefault().addMethodHandler("getServerInfo", new ServletProxyFactory.MethodHandler() { @Override public Object handle(Object clazz, Method method, Object[] methodObjects) { return "Playtosphere/2.0.0"; } }); framework().init(); return this; }
@Override public void init(final ServletConfig sc) throws ServletException { framework().interceptor(new CometdAtmosphereInterceptor()); framework().setUseStreamForFlushingComments(false); framework().addInitParameter("transports", WebSocketTransport.class.getName()); framework().addInitParameter(ApplicationConfig.WEBSOCKET_CONTENT_TYPE, "application/json"); super.init(sc); ReflectorServletProcessor r = new ReflectorServletProcessor(); r.setServletClassName(org.cometd.java.annotation.AnnotationCometdServlet.class.getName()); framework().addAtmosphereHandler("/*", r).initAtmosphereHandler(framework().getServletConfig()); }