atmosphere.init(vaadinServletConfig);
@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); } }
@Override public void init(ServletConfig config) throws ServletException { super.init(config); WebApplicationContextUtils. getRequiredWebApplicationContext(getServletContext()). getAutowireCapableBeanFactory(). autowireBean(this); // set the real servlet context atmosphereSpringContext.setServletContext(config.getServletContext()); framework.init(atmosphereSpringContext, false); }
public AtmosphereCoordinator ready() { framework().init(); webSocketProcessor = WebSocketProcessorFactory.getDefault().getWebSocketProcessor(framework); return this; }
protected void activate() { super.activate(); if (handler.getServletContext().getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") == null) { try { Class<?> dcc = ClassUtils.forName("org.eclipse.jetty.util.DecoratedObjectFactory", getClass().getClassLoader()); handler.getServletContext().setAttribute("org.eclipse.jetty.util.DecoratedObjectFactory", dcc.newInstance()); } catch (ClassNotFoundException | LinkageError | InstantiationException | IllegalAccessException e) { //ignore, old version of Jetty } } ServletConfig config = new VoidServletConfig(initParams) { @Override public ServletContext getServletContext() { return handler.getServletContext(); } }; try { framework.init(config); } catch (ServletException e) { throw new Fault(new Message("Could not initialize WebSocket Framework", LOG, e.getMessage()), e); } }
protected void activate() { super.activate(); if (handler.getServletContext().getAttribute("org.eclipse.jetty.util.DecoratedObjectFactory") == null) { try { Class<?> dcc = ClassUtils.forName("org.eclipse.jetty.util.DecoratedObjectFactory", getClass().getClassLoader()); handler.getServletContext().setAttribute("org.eclipse.jetty.util.DecoratedObjectFactory", dcc.newInstance()); } catch (ClassNotFoundException | LinkageError | InstantiationException | IllegalAccessException e) { //ignore, old version of Jetty } } ServletConfig config = new VoidServletConfig(initParams) { @Override public ServletContext getServletContext() { return handler.getServletContext(); } }; try { framework.init(config); } catch (ServletException e) { throw new Fault(new Message("Could not initialize WebSocket Framework", LOG, e.getMessage()), e); } }
public void init(final ServletConfig sc) throws ServletException { super.init(sc); framework.setAsyncSupport(new WebLogicCometSupport(framework.getAtmosphereConfig())); framework.init(sc); }
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; }
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); } }
atmosphere.init(vaadinServletConfig); } catch (ServletException e) { throw new RuntimeException("Atmosphere init failed", e);
framework().init(sc);
atmosphere.init(vaadinServletConfig);
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(); }
framework.externalizeDestroy(true).init(new NettyServletConfig(config.initParams(), ctx)); } catch (ServletException e) { throw new RuntimeException(e);
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(); }
framework.externalizeDestroy(true).init(new NettyServletConfig(config.initParams(), ctx)); } catch (ServletException e) { throw new RuntimeException(e);